Iceberg compaction always fails for primary-key tables — RewriteFiles committed after RowDelta
Los mantenedores suelen responder en 1 día
@Anurag15v ya está trabajando en esto.
Desde el 3/10/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- data-engineering, databases
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Java
- Estrellas
- 2.2k
- Forks
- 646
- Merge medio
- 2 d 28 min
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/fluss
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` keyPosiblemente ocupada @aphenix-r7 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[common] Decimal#hashCode is inconsistent with Decimal#equalsPosiblemente ocupada @firasbouzazi la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/fluss#4538 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[security] PlainSaslServerProvider conflicts with Hadoop SASL provider causing authentication failurePosiblemente ocupada @xinzhang-hello la tomó hace 18 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
[server] KV snapshot scheduling stops permanently after a transient snapshot-init failurePosiblemente ocupada @zhang-arvin la tomó hace 18 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/fluss#4489 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[docs] Document advertised-resource and ACL principal ignore-case optionsPosiblemente ocupada @EchoLee5 la tomó hace 30 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
Todos los issues de apache/fluss
Issues similares
-
Authorization 'Artifacts' is shown under category Run instead of Job in Authorization matrixAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/rocketmq-dashboard#6872 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ADORSYS-GIS/token-status-link#168 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ADORSYS-GIS/keycloak-oid4vp-plugin#232 ·
Los mantenedores suelen responder en 2 días
-
Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
wso2/product-integrator-mi#5099 ·
Los mantenedores suelen responder en 1 día