Flink: DynamicIcebergSink in overwrite mode silently drops delete files

オープン
#18,843 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@zhengxiang378928908-code がすでに取り組んでいます。

2026年11月9日 から。

  • #18844 @zhengxiang378928908-code による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java

調査の方向性

Start in flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicCommitter.java, around replacePartitions, where only WriteResult data files are added to ReplacePartitions. Compare with the delete-file check in sink/IcebergCommitter.java near the 'Cannot overwrite partitions with delete files.' message. Done means overwrite with delete files is rejected in the dynamic sink, with a test in TestDynamicIcebergSink. A pull request (#18844) is already open, so coordinate with it first.

索引モデルが issue の本文から書いたものです。

説明

With overwrite(true), DynamicCommitter.replacePartitions adds only the data files of each WriteResult to the ReplacePartitions operation (DynamicCommitter.java#L285-L298). Delete files produced by upserts or CDC deletes are omitted from the overwrite commit without being rejected, which can leave rows visible that those deletes should remove. The Flink docs state that OVERWRITE and UPSERT are mutually exclusive, and IcebergSink and FlinkSink enforce this when the job is built; IcebergCommitter also fails with Cannot overwrite partitions with delete files. The dynamic sink has neither check. The same overwrite commit path exists in Flink 1.20, 2.2 and 2.3.

Reproduction on main at 5b99042b4 (Flink 2.3, TestDynamicIcebergSink style): write the same row four times to an unpartitioned table with upsertMode=true, equality field id, and overwrite(true). In the observed run the job succeeds and reading the table returns 3 identical rows. The final overwrite replaced an earlier one-record data file with a three-record file, so the exact count depends on checkpoint timing. The last snapshot has replace-partitions=true and total-delete-files=0.

Expected: reject overwrite results that contain delete files, as the other sinks do, instead of committing only their data files.

主要言語
Java
スター
9.4k
フォーク
3.7k
平均マージ
2日 15時間
マージ済み PR(30日)
169

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iceberg のほかの issue

apache/iceberg の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。