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

Aperta
#19,154 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@jiwen624 ci sta già lavorando.

Dal 29/11/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Java
Stelle
9.5k
Fork
3.7k
Merge medio
2g 2h
PR unite (30g)
170

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iceberg

Tutte le issue di apache/iceberg

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.