Iceberg compaction always fails for primary-key tables — RewriteFiles committed after RowDelta
I maintainer di solito rispondono entro 1 giorno
@Anurag15v ci sta già lavorando.
Dal 3/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- data-engineering, databases
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- Lingua principale
- Java
- Stelle
- 2.2k
- Fork
- 656
- Merge medio
- 2g 2h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/fluss
-
[CI] NettyClientTest.testServerDisconnection may fail with DisconnectExceptionForse già presa @yangshangqing95 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` keyForse già presa @aphenix-r7 l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/fluss#4658 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[common] Decimal#hashCode is inconsistent with Decimal#equalsForse già presa @firasbouzazi l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/fluss#4538 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failureForse già presa @xinzhang-hello l’ha presa 20 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failureForse già presa @zhang-arvin l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
apache/fluss#4489 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/fluss
Issue simili
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
carlos-emr/carlos#4933 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Vakore/ZappierGames#147 ·
-
Post 1.11.2 to SpigotMCApertaspigotmc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
Dans-Plugins/Wild-Pets#356 ·
I maintainer di solito rispondono entro 1 giorno
-
Post 1.16.2 to SpigotMCApertaspigotmc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Dans-Plugins/Medieval-Roleplay-Engine#371 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
eddyizm/tempus#1220 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni