Flink: DynamicIcebergSink in overwrite mode silently drops delete files

Abierto
#18,843 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@zhengxiang378928908-code ya está trabajando en esto.

Desde el 9/11/2026.

  • #18844 de @zhengxiang378928908-code — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
18/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
java

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
9.4k
Forks
3.7k
Merge medio
2 d 15 h
PR fusionados (30 d)
169

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iceberg

Todos los issues de apache/iceberg

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.