Skip to content

Flink 1.20, 2.0: Fix file offset mismatch in DataIterator.seek() when files are skipped#16950

Merged
pvary merged 1 commit into
apache:mainfrom
zhongyujiang:fix/flink-data-iterator-file-offset-mismatch-other-versions
Jun 25, 2026
Merged

Flink 1.20, 2.0: Fix file offset mismatch in DataIterator.seek() when files are skipped#16950
pvary merged 1 commit into
apache:mainfrom
zhongyujiang:fix/flink-data-iterator-file-offset-mismatch-other-versions

Conversation

@zhongyujiang

@zhongyujiang zhongyujiang commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Cherry-pick of #16929 to Flink 1.20 and Flink 2.0.

cc @pvary Could you please review?

… files are skipped

Port of apache#16929 (Flink 2.1) to Flink 1.20 and Flink 2.0.

DataIterator.seek() overwrites fileOffset after updateCurrentIterator() has
correctly advanced it past files skipped by residual filters. This causes
checkpoint to record a wrong file offset, leading to duplicate consumption
or IllegalStateException on recovery.

The fix:
1. Increment fileOffset in the skip-files loop so it tracks position as
   files are skipped
2. Remove the incorrect fileOffset/recordOffset assignments at the end
   of seek()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the flink label Jun 24, 2026
@pvary pvary merged commit d1f789e into apache:main Jun 25, 2026
32 checks passed
@pvary

pvary commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Merged to main.
Thanks @zhongyujiang for the backport and @wombatu-kun for the review!

@zhongyujiang zhongyujiang deleted the fix/flink-data-iterator-file-offset-mismatch-other-versions branch June 25, 2026 13:39
jakelong95 pushed a commit to jakelong95/iceberg that referenced this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants