Iceberg compaction always fails for primary-key tables — RewriteFiles committed after RowDelta
メンテナーはふだん 1 日以内に返信
@Anurag15v がすでに取り組んでいます。
2026年10月3日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
Start in IcebergLakeCommitter.commit() around lines 132 and 139, then read IcebergRewriteTest to understand the existing append-only coverage. Add coverage for a primary-key table with equality deletes and verify RewriteFiles is committed before RowDelta. Done means rewrite commits succeed, replace operations appear in snapshot history, and compacted file counts decrease.
索引モデルが issue の本文から書いたものです。
説明
Search before asking
- I searched in the issues and found nothing similar.
Fluss version
0.9.1-incubating
Please describe the bug 🐞
IcebergLakeCommitter.commit() commits the RowDelta (new data + equality deletes) before the RewriteFiles (compaction). For PK tables using merge-on-read, every RowDelta adds equality delete files targeting existing data files in the same partitions. When commitRewrite() runs immediately after, validateFromSnapshot() detects those new deletes and rejects the commit.
Log evidence:
ERROR org.apache.fluss.lake.iceberg.tiering.IcebergLakeCommitter - Failed to commit rewrite files to iceberg, delete rewrite added files [...]
org.apache.iceberg.exceptions.ValidationException: Cannot commit, found new delete for replaced data file: GenericDataFile{content=data, ...}
at org.apache.iceberg.exceptions.ValidationException.check(ValidationException.java:49)
This happens on every commit cycle for PK tables. The snapshot history confirms compaction never commits — every operation is overwrite (RowDelta), never replace (RewriteFiles):
operation total-data-files
overwrite 312
overwrite 310
overwrite 308
overwrite 306
The file count grows monotonically (one file per bucket per commit), with no compaction.
Root cause: Commit ordering in IcebergLakeCommitter.commit() (line 132 vs 139). The RowDelta commits first, adding equality deletes that target the files the rewrite wants to replace.
// Current: RowDelta first, RewriteFiles second
long snapshotId = commit(snapshotUpdate, snapshotProperties); // line 132 — RowDelta adds deletes
List<RewriteDataFileResult> rewriteDataFileResults =
committable.rewriteDataFileResults();
if (!rewriteDataFileResults.isEmpty()) {
Long rewriteCommitSnapshotId =
commitRewrite(rewriteDataFileResults, snapshotProperties); // line 139 — always fails
}
Append-only tables are unaffected because AppendFiles adds no delete files.
Test coverage gap: The existing IcebergRewriteTest only covers append-only tables (no identifier fields in the schema). PK tables with equality deletes are untested.
Also affects main (as of dd2d30a).
Solution
Swap the commit order — RewriteFiles first, RowDelta second. The rewrite validates from the snapshot it was planned against; committing it before the RowDelta means no new deletes exist yet, so validation passes. The RowDelta's equality deletes then correctly target the compacted files (which have a lower sequence number).
After applying the fix, replace operations appear and the file count drops immediately:
operation total-data-files
overwrite 4
replace 2
overwrite 6
Are you willing to submit a PR?
- I'm willing to submit a PR!
- 主要言語
- Java
- スター
- 2.2k
- フォーク
- 646
- 平均マージ
- 2日 28分
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/fluss のほかの issue
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` key対応中かも @aphenix-r7 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[common] Decimal#hashCode is inconsistent with Decimal#equals対応中かも @firasbouzazi が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/fluss#4538 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failure対応中かも @xinzhang-hello が 18 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failure対応中かも @zhang-arvin が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/fluss#4489 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[docs] Document advertised-resource and ACL principal ignore-case options対応中かも @EchoLee5 が 30 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothing対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンjules
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-learning-exchange/myplanet#18199 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Scheme-less stream URLs throw NullPointerException instead of URISyntaxException対応中かも @blihio が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pedroSG94/RootEncoder#2218 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/rocketmq-dashboard#6872 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ADORSYS-GIS/token-status-link#168 ·
メンテナーはふだん 2 日以内に返信