CuratorCache initialization overhead with many empty ZNodes
評価
- 難易度
- 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/curator のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
Optimize storage for single-node CuratorCache対応中かも @waterWang が 64 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
TreeCache.iterator() throws NoSuchElementException after a parent node's last child is deleted対応中かも @apm1467 が 65 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
Add Jackson PolymorphicTypeValidator対応中かも @pjfanning が 15 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
-
Upgrade to Jackson 3オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 2 日以内に返信
-
code-health feature/sync OS/Android QA/Test-Plan-Specified QA/Yes
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
brave/brave-browser#60327 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws/context-ontology-accelerator#325 ·
メンテナーはふだん 1 日以内に返信
-
The README tells to run `mvn jeo:disassemble`, which fails with `No plugin found for prefix 'jeo'`オープン
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
objectionary/jeo-maven-plugin#1938 ·
メンテナーはふだん 2 日以内に返信
-
effort/l priority/p2 risk/high triage/deferred
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
iflytek/skillhub#1039 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信