CuratorCache initialization overhead with many empty ZNodes
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- java
- Ambito
- databases, distributed-systems
Direzione di ricerca
Inizia ricostruendo il flusso di inizializzazione di CuratorCache descritto nell’issue, concentrandoti sui punti in cui vengono usate le chiamate a Stat e getChildren. Confronta la scorciatoia proposta per le directory vuote con il comportamento persistente del watcher ricorsivo e con la semantica prevista di completezza dell’inizializzazione; il lavoro è completato quando esiste una direzione di implementazione concordata o un motivo documentato per mantenere il comportamento attuale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi Curator team,
We are using:
- Curator version: 5.6.0
- ZooKeeper version: 3.8.4
In one of our environment we do observe roughly ~50k znodes, where about ~45k of them are empty directories. And this numbers are huge in higher envs.
During CuratorCache initialization we observe that getChildren calls are issued across the tree, including for these empty directories. Since getChildren is relatively latency-heavy, this significantly increases cache initialization time at this scale.
In our use case, strict initial enumeration completeness is not required, because we rely on persistent recursive watchers and eventually receive create events for newly added nodes. Our internal cache can converge to the correct state through those events.
While reviewing the initialization flow, we noticed that Stat is already retrieved for nodes. Since Stat contains numChildren, we were wondering whether it would be reasonable to optimize the initialization logic as follows:
if (stat.getNumChildren() == 0) skip getChildren()
This would avoid issuing getChildren() calls for nodes that are already known to have no children, which could significantly reduce initialization overhead in environments with a large number of empty directories.
Our assumption is that correctness would still be preserved because:
- persistent recursive watchers would capture future child creation events
- the cache would eventually converge to the correct state
Conceptually the idea is to reduce initialization overhead for environments with a large number of empty directories, while still allowing the cache to converge to the correct state through watcher events.
Would this optimization be compatible with the intended semantics of CuratorCache initialization, or is there a reason getChildren() must always be executed even when stat.getNumChildren() == 0?
Or is there a recommended way to optimize initialization behavior for this type of large namespace with many empty nodes?
Thanks in advance for any guidance.
Best regards,
Viswanathan
- Lingua principale
- Java
- Stelle
- 3.2k
- Fork
- 1.2k
- Merge medio
- 14h 48m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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/curator
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Optimize storage for single-node CuratorCacheForse già presa @waterWang l’ha presa 65 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
-
TreeCache.iterator() throws NoSuchElementException after a parent node's last child is deletedForse già presa @apm1467 l’ha presa 67 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
Add Jackson PolymorphicTypeValidatorForse già presa @pjfanning l’ha presa 17 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
-
Upgrade to Jackson 3Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Tutte le issue di apache/curator
Issue simili
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
authorjapps/zerocode#808 ·
-
upgrade to checkstyle 14.4.0Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
checkstyle/sonar-checkstyle#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
quarkusio/quarkus-agent-mcp#302 ·
I maintainer di solito rispondono entro 2 giorni
-
build
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
MetricsHub/metricshub-community#1472 ·
I maintainer di solito rispondono entro 1 giorno