Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[server] Old table cleanup removes recreated table path mapping

Aperta
#4,655 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@luoyuxia ci sta già lavorando.

Dal 15/10/2026.

  • #4657 di @luoyuxia — aperta

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

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
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:

  1. The old table has tablePathById[X] = P and tableIdByPath[P] = X.
  2. Drop X, then recreate P as Y before the old cleanup completes. putTablePath(Y, P) sets tableIdByPath[P] = Y; tableInfoById[Y] is populated.
  3. The delayed cleanup calls removeTable(X). It removes tablePathById[X], then unconditionally calls tableIdByPath.remove(P), even though that entry now belongs to Y.
  4. getTableIdByPath(P) returns UNKNOWN_TABLE_ID, while getTableInfoById(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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/fluss

Tutte le issue di apache/fluss

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.