Flink: Streaming from a missing branch can plan main's files and fail with a misleading error

Abierto
#19,154 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@jiwen624 ya está trabajando en esto.

Desde el 29/11/2026.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

The issue identifies IcebergSource and the automatic starting strategies, but does not name source files or tests. Start by tracing how the source initializes a streaming position and discovers snapshots for a branch, then inspect tests for the listed strategies. Done means the chosen missing-branch behavior is explicit and avoids misleading planning failures or skipped files; the issue leaves that behavior undecided.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Apache Iceberg version

None

Query engine

None

Please describe the bug 🐞

When IcebergSource streams from a branch that doesn't exist, the automatic starting strategies initialize the position from main, but later discovery looks up the branch and finds no snapshot. If the saved position is non-null, planning throws Invalid last enumerated position for an empty table: not null, which doesn't mention the branch, and the job fails once max-allowed-planning-failures (default 3) is exceeded.

  • TABLE_SCAN_THEN_INCREMENTAL: plans main's files, so rows from main may be emitted before the failure.
  • INCREMENTAL_FROM_LATEST_SNAPSHOT_EXCLUSIVE: fails whenever main has a current snapshot.
  • INCREMENTAL_FROM_LATEST_SNAPSHOT, INCREMENTAL_FROM_EARLIEST_SNAPSHOT: fail if the chosen start snapshot has a parent ID (e.g. main has 2+ snapshots, or older snapshots were expired). Otherwise they wait.

When the table has no current snapshot, these strategies wait and read the branch once it's created, so failing fast would change existing behavior. Simply treating a missing branch as empty doesn't work either: TABLE_SCAN_THEN_INCREMENTAL then skips its initial scan once the branch appears and misses still-live files from expired snapshots. Waiting would need the source to stay uninitialized until the branch exists.

Should a missing branch fail, or wait for the branch to be created? A clearer error naming the branch would help either way. Found while working on #19099, which keeps this behavior unchanged.

Willingness to contribute
  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
Lenguaje dominante
Java
Estrellas
9.5k
Forks
3.7k
Merge medio
2 d 2 h
PR fusionados (30 d)
170

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iceberg

Todos los issues de apache/iceberg

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.