[server] Periodic KV snapshot initialization races with Replica deletion
I maintainer di solito rispondono entro 1 giorno
@MaheshS08 ci sta già lavorando.
Dal 13/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 53/100
Direzione di ricerca
Start with Replica.delete() and Replica.dropKv(), then trace how closeableRegistryForKv closes PeriodicSnapshotManager and how snapshot initialization runs under kvLock. Use the deterministic regression described in the issue with the existing ReplicaTest fixtures to reproduce the registry-closing window. Done means deletion stops or synchronizes periodic snapshot initialization before the KV registry closes, with the regression confirming no closed-registry IOException is logged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search before asking
- I searched in the issues and found nothing similar.
Fluss version
main (development)
Please describe the bug 🐞
Periodic KV snapshot initialization can race with Replica deletion and attempt to register resources after the Replica's KV registry has been closed.
java.io.IOException: Cannot register Closeable, registry is already closed. Closing argument.
at AbstractAutoCloseableRegistry.registerCloseable
at AsyncSnapshotCallable$AsyncSnapshotTask.<init>
at AsyncSnapshotCallable.toAsyncSnapshotFutureTask
at SnapshotRunner.snapshot
at KvTabletSnapshotTarget.initSnapshot
at PeriodicSnapshotManager.lambda$triggerSnapshot$2
Replica.dropKv() closes closeableRegistryForKv. The registry first sets closed=true, then closes its registered resources, including PeriodicSnapshotManager. A scheduled snapshot can still run between these steps and reach task registration while the registry is already closed.
The manager's close() also does not serialize with snapshot initialization under the tablet's kvLock, so cancelling the scheduled future alone does not cover an initialization already in progress.
Deterministic reproduction
A local regression uses the existing ReplicaTest fixtures and real Replica, RocksDB, snapshot target, runner and registry:
- Create a KV leader, write and flush records, and retain the snapshot timer automatically scheduled during leader initialization.
- Register a latch-controlled Closeable after the snapshot manager. Call
Replica.delete()on another thread and pause resource closing after the registry becomes closed, before the manager stops. - Execute the original scheduled timer, then release the latch and wait for deletion to finish.
This enlarges a valid closing window without mocking the initialization exception. The assertion that no closed-registry IOException is logged fails on both revisions:
| Regression | Base b530fcc2 |
PR #4492 19870c605 |
|---|---|---|
| Retry after snapshot-init failure | Fails: no replacement task | Passes |
| Snapshot initialization during Replica deletion | Fails: closed-registry IOException | Fails: same IOException |
Four occurrences were observed during test table deletion. Deletion completed, and no snapshot corruption was established.
Expected behavior
Replica deletion should stop or cancel periodic snapshots cleanly, without allowing snapshot task registration after the KV registry closes.
Solution
Serialize stopping the snapshot manager with snapshot initialization before closing the KV registry and dropping the tablet, while preserving cancellation and cleanup of already registered tasks.
Related: #4489 and #4492 address retry after initialization failure. The closing race exists before that PR and requires a separate lifecycle fix.
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 17h
- PR unite (30g)
- 106
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
-
[lake/iceberg] Reserved write-mode properties can be set and reset through their `iceberg.` keyForse già presa @aphenix-r7 l’ha presa 5 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 17 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 23 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 23 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
-
[docs] Document advertised-resource and ACL principal ignore-case optionsForse già presa @EchoLee5 l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/fluss
Issue simili
-
area: android good first issue help wanted testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Gautam-aman/ResQNet#56 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation hermes-queue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
chrisalunlloyd2-sudo/mindpalace#294 ·
I maintainer di solito rispondono entro 1 giorno
-
better night vision compatAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QuicksilverMC/Argentum#31 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
saysky/ForestBlog#111 ·
-
hawkbit-dmf-server 1.1.0 does not start: NoClassDefFoundError jakarta/servlet/ServletResponseAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
eclipse-hawkbit/hawkbit#3429 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno