Skip to content

Add Keeper ListWithOptions support - #117521

Merged
alexey-milovidov merged 11 commits into
masterfrom
keeper-list-with-shuffle
Sep 28, 2026
Merged

alexey-milovidov merged 11 commits into
masterfrom
keeper-list-with-shuffle

Conversation

@antonio2368

@antonio2368 antonio2368 commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Adds the Keeper ListWithOptions operation for direct and recursive listing with filtering, optional stats and data, limits, and deterministic request-scoped shuffled ordering.

The feature is enabled by default.

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Add the Keeper ListWithOptions operation for filtered direct or recursive listing with optional stats, data, limits, and shuffled results.


Workflow [PR]
Sync PR [sync-upstream/pr/117521]

Version info

  • Merged into: 26.10.1.872-master (included in 26.10 and later)

@clickhouse-gh

clickhouse-gh Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [68a4ed3]

Summary: ✅

LLVM Coverage Report

Measured on commit 68a4ed3.

Metric Baseline Current Δ
Lines 88.10% 88.10% +0.00%
Functions 91.70% 91.70% +0.00%
Branches 79.40% 79.40% +0.00%

Changed lines: Changed C/C++ lines covered: 352/561 (62.75%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Sep 1, 2026
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
Comment thread src/Common/ZooKeeper/TestKeeper.cpp Resolved
antonio2368 added a commit that referenced this pull request Sep 2, 2026
Remove virtual-method default arguments to satisfy clang-tidy.

Use the outer multi-read XID and subrequest index for shuffled `ListWithOptions` ranks.

CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117521&sha=latest&name_0=PR check failure
PR: #117521
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
Comment thread src/Common/ZooKeeper/TestKeeper.cpp Resolved
@antonio2368
antonio2368 force-pushed the keeper-list-with-shuffle branch from 026a3bb to 4c03a4e Compare September 2, 2026 08:41
antonio2368 added a commit that referenced this pull request Sep 2, 2026
Remove virtual-method default arguments to satisfy clang-tidy.

Use the outer multi-read XID and subrequest index for shuffled `ListWithOptions` ranks.

CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117521&sha=latest&name_0=PR check failure
PR: #117521
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
@antonio2368
antonio2368 force-pushed the keeper-list-with-shuffle branch from 4c03a4e to 9f26dfe Compare September 2, 2026 09:57
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 68a4ed39d with master 68694750f (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

31 object files changed (+210.52 KiB total), 0 added.

Object file Master PR Δ
src/Common/ZooKeeper/CMakeFiles/clickhouse_common_zookeeper_base.dir/TestKeeper.cpp.o 577.91 KiB 626.24 KiB +48.32 KiB (+8.36%)
src/Common/ZooKeeper/CMakeFiles/clickhouse_common_zookeeper_base.dir/ZooKeeperCommon.cpp.o 1.02 MiB 1.06 MiB +44.64 KiB (+4.27%)
src/CMakeFiles/dbms.dir/Coordination/KeeperStorageImpl.cpp.o 883.88 KiB 924.38 KiB +40.50 KiB (+4.58%)
src/Common/ZooKeeper/CMakeFiles/clickhouse_common_zookeeper_base.dir/ZooKeeper.cpp.o 900.69 KiB 927.66 KiB +26.96 KiB (+2.99%)
src/Common/ZooKeeper/CMakeFiles/clickhouse_common_zookeeper_base.dir/KeeperOverDispatcher.cpp.o 208.20 KiB 226.72 KiB +18.53 KiB (+8.90%)
src/Common/ZooKeeper/CMakeFiles/clickhouse_common_zookeeper.dir/ZooKeeperImpl.cpp.o 797.81 KiB 814.77 KiB +16.95 KiB (+2.12%)

716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

553 translation units recompiled, 4440 s compile time in total, 553 of them have a recent master baseline.

Job report

Classify `ListWithOptions` as thread-safe in `processLocalRequests` so it uses the parallel read phase.

Review: #117521 (comment)

PR: #117521
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-keeper ClickHouse Keeper (Raft-based coordination layer; ZooKeeper replacement) and ZooKeeper client lib... label Sep 4, 2026
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
# Conflicts:
#	programs/keeper-bench/Runner.cpp
Use a random shuffle for complete results and a prefix-only shuffle when `max_results` limits a known candidate set.
Factor full and prefix-only shuffle selection behind `shuffle_with_limit` and test it with a seeded RNG.
Add scoped traces and verify that shuffled results change order across repeated requests.
Comment thread src/Coordination/KeeperStorageImpl.cpp Resolved
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 28, 2026
Merged via the queue into master with commit cf0b584 Sep 28, 2026
177 checks passed
@alexey-milovidov
alexey-milovidov deleted the keeper-list-with-shuffle branch September 28, 2026 03:15
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 28, 2026
seva-potapov added a commit to seva-potapov/ClickHouse that referenced this pull request Sep 28, 2026
PR ClickHouse#117521 added the ListWithOptions op to Keeper. The
forEachRequestPath switch in the orphan-cleanup verifier was missing a
case for it, causing -Werror,-Wswitch build failures when merged with
current master.

ListWithOptions supports both direct and recursive listing via its
options, so the kind is determined dynamically: Subtree when
options.recursive is set, NodeAndChildren otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-keeper ClickHouse Keeper (Raft-based coordination layer; ZooKeeper replacement) and ZooKeeper client lib... pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants