Flink: Streaming accepts a start-snapshot-id that is not on the streamed branch

Open
#19,171 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@jiwen624 is already working on this.

Since Nov 29, 2026.

  • #19196 by @jiwen624 — open

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
java

Research direction

Read ContinuousSplitPlannerImpl.startSnapshot and the incremental snapshot discovery path for Flink streaming. Trace how the streamed ref's head and snapshot ancestry are checked at startup, then find the related tests for INCREMENTAL_FROM_SNAPSHOT_ID. Done means startup rejects a start snapshot outside the streamed ref's ancestry with an error naming the snapshot and branch; an open pull request is already linked.

Written by the indexing model from the issue text.

Description

bug
Apache Iceberg version

None

Query engine

Flink

Please describe the bug 🐞

With starting-strategy=INCREMENTAL_FROM_SNAPSHOT_ID, ContinuousSplitPlannerImpl.startSnapshot only checks that start-snapshot-id exists in the table, not that it is in the history of the streamed branch (or main). Raised in https://github.com/apache/iceberg/pull/19099#discussion_r4728049051 from @timothyw553

main:  F ── M1 ── M2
        \
b1:      B1

Stream b1:

  • start-snapshot-id = M1 (parent F is on b1): startup succeeds and the job streams b1 from F, so the configured start snapshot is ignored without an error.
  • start-snapshot-id = M2 (parent M1 is not on b1): startup succeeds, and the first incremental discovery fails with Starting snapshot (exclusive) <M1> is not a parent ancestor of end snapshot <B1>.

The same applies when streaming main with a snapshot that is only on a branch.

Proposal: reject a start snapshot that is not an ancestor of the streamed ref's head at startup, with an error naming the snapshot and the branch.

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
Dominant language
Java
Stars
9.5k
Forks
3.7k
Avg merge
2d 2h
Merged PRs (30d)
170

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg

All issues in apache/iceberg

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.