[Bug] Data evolution self-merge can cross rollback snapshot lineage
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python, spark
Línea de trabajo
Empieza ejecutando la reproducción ABA del rollback de Spark 3.5; después, sigue la identidad del snapshot base a través del staging de self-merge de Spark y la detección de conflictos de commit, y a continuación la implementación de PyPaimon Ray. Añade una cobertura de regresión equivalente para los casos latest < base, same-ID/different-UUID y rollback ABA. Se considera terminado cuando las actualizaciones de linajes antiguos fallen de forma segura o dejen sin cambios las filas de reemplazo en ambas implementaciones.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
Data evolution self-merge validates staged row-ID partial updates using the base snapshot ID, but not the snapshot UUID or lineage. Both the current Spark implementation and the PyPaimon Ray implementation in #9339 treat snapshot IDs as sufficient identity.
A rollback can delete newer snapshots, after which new commits reuse the same numeric snapshot IDs. A staged update from the old snapshot can therefore be accepted against a different replacement snapshot with the same ID (an ABA problem).
Reproduction
This has been reproduced with Spark 3.5:
- Enable row tracking and data evolution.
- Create snapshot 1 containing
(id=1, b=10). - Create snapshot 2 containing
(id=2, b=20). - Stage a self-merge partial update
b = b + 1forid=2, based on the original snapshot 2. - Roll back the table to snapshot 1.
- Insert
(id=30, b=300), recreating snapshot ID 2 with a different UUID and reusing the relevant row ID. - Commit the old staged update.
Expected: (id=30, b=300) remains unchanged, or the old commit fails closed.
Actual: the commit succeeds and produces (id=30, b=21). The old update is silently applied to the replacement row.
Trigger window and impact
The trigger window is narrow: a self-merge must remain staged across a rollback, snapshot IDs must be recreated, and row-ID ranges must overlap. However, the impact is a silent wrong-row update rather than a clean commit failure.
Follow-up scope
Fix Spark and Python together so that their behavior remains aligned:
- fail closed when
latest snapshot ID < base snapshot ID; - detect equal snapshot IDs with different snapshot UUIDs;
- prevent rollback snapshot-ID reuse from accepting staged updates from an old lineage;
- decide how the base snapshot UUID is carried through self-merge staging and commit conflict detection;
- add equivalent Spark and Python regression tests for
latest < base, same-ID/different-UUID, and rollback ABA.
PR #9339 intentionally does not address this lineage problem. It remains aligned with the current Spark behavior and is scoped to forward snapshot rebase, conflict retry, and safe abort/temporary-file cleanup.
- Lenguaje dominante
- Java
- Estrellas
- 3.4k
- Forks
- 1.4k
- Merge medio
- 1 d 14 h
- PR fusionados (30 d)
- 468
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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/paimon
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
[Bug] [Hive] IndexOutOfBoundsException when converting an unavailable dynamic BETWEEN predicate Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Todos los issues de apache/paimon
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
infinispan/infinispan#18150 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
opensearch-project/k-NN#3597 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100