[server] Old table cleanup removes recreated table path mapping
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- backend, distributed-systems
Línea de trabajo
Start in CoordinatorContext.removeTable, where tableIdByPath.remove(tablePath) runs unconditionally, and compare it with putTablePath, which overwrites the path mapping for a recreated table. Make the reverse-mapping removal conditional on the entry still pointing to the deleted ID, and add a unit test that puts the old ID, puts the new ID for the same path, removes the old ID, then asserts the path still resolves to the new ID. Also check processTableRegistrationChange for the null TableInfo case. Done when the regression test passes and no null dereference remains on that path.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Search before asking
- I searched in the issues
Fluss version
main (development). The failure symptom was observed on a downstream 0.9-ali-1.0 build; the CoordinatorContext.removeTable behavior described below is also present on current Apache Fluss main.
Please describe the bug 🐞
CoordinatorContext keeps both tablePathById and tableIdByPath. When a table is dropped, its ZooKeeper table node is deleted first, while replica/assignment cleanup completes later. This allows a table with the same path to be created with a new ID before the old ID reaches CoordinatorContext.removeTable.
For a path P, old ID X, and new ID Y, the following state transition loses the new table's reverse mapping:
- The old table has
tablePathById[X] = PandtableIdByPath[P] = X. - Drop
X, then recreatePasYbefore the old cleanup completes.putTablePath(Y, P)setstableIdByPath[P] = Y;tableInfoById[Y]is populated. - The delayed cleanup calls
removeTable(X). It removestablePathById[X], then unconditionally callstableIdByPath.remove(P), even though that entry now belongs toY. getTableIdByPath(P)returnsUNKNOWN_TABLE_ID, whilegetTableInfoById(Y)can still return the new table.
A small CoordinatorContext unit test can reproduce the mapping loss without relying on timing:
context.putTablePath(oldId, path);
context.putTablePath(newId, path);
context.removeTable(oldId);
assertThat(context.getTableIdByPath(path)).isEqualTo(newId); // currently fails
Expected: Completing deletion of X must preserve the mapping P -> Y.
Actual: The mapping is removed. A subsequent table registration change resolves P to UNKNOWN_TABLE_ID; processTableRegistrationChange checks only for null, so it obtains a null oldTableInfo and can throw at oldTableInfo.getSchemaInfo(). The lake tiering manager may still retain Y, because its state is keyed separately by table ID.
We observed repeated TablePropertiesChangeEvent failures when setting table.datalake.enabled=false, with oldTableInfo null, while tiering continued to request the affected table. The historical drop/recreate sequence for that deployment is unavailable, so this production symptom is consistent with, but does not prove, the race above.
Solution
In CoordinatorContext.removeTable, remove the reverse mapping only if it still points to the table being deleted, for example tableIdByPath.remove(tablePath, tableId). Add a regression test for the old-ID/new-ID sequence above. Also handle UNKNOWN_TABLE_ID (and a missing TableInfo) in processTableRegistrationChange with a diagnostic log instead of a NullPointerException; that guard alone would not preserve the mapping.
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
-
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
-
Wrong link to test resultsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
docs(site): Mermaid edge-label contrast on Architecture and a table header on How it comparesAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
devops-thiago/ThrillhouseBot#1132 ·
Los mantenedores suelen responder en 1 día