[server] Old table cleanup removes recreated table path mapping
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- backend, distributed-systems
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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!
- 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 19 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 19 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
-
False Negative: InnerTypeLastCheck does not report members declared after inner enums or annotationsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
checkstyle/checkstyle#22027 ·
I maintainer di solito rispondono entro 1 giorno
-
bug follow-up lane:auto
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Sanne/incus-spawn#1497 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
backend Good for newcomer quick win
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
CodeForPhilly/benefit-decision-toolkit#562 ·
I maintainer di solito rispondono entro 1 giorno