Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CuratorCache initialization overhead with many empty ZNodes

オープン
#1,289 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

@2748109647 がすでに取り組んでいます。

2026年10月20日 から。

  • #1313 @2748109647 による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java

調査の方向性

issue に記載された CuratorCache の初期化フローを追跡することから始め、Stat と getChildren の呼び出しがどこで使用されているかに注目します。提案されている空ディレクトリのショートカットを、永続的な再帰 watcher の動作および意図された初期化完了のセマンティクスと比較します。合意された実装方針が決まるか、現在の動作を維持する理由が文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Java
スター
3.2k
フォーク
1.2k
平均マージ
14時間 48分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/curator のほかの issue

apache/curator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。