20 Commits
Author SHA1 Message Date
Mikhail Artemenko 7a76ad4177 fix keeper-bench build 2026-06-19 14:54:29 +00:00
Michael Kolupaev a859e0d084 Review comments 2026-06-09 00:44:21 -07:00
Michael Kolupaev 879d219071 Review comments 2026-06-01 21:46:23 -07:00
Michael Kolupaev a4fae9f8dd Merge remote-tracking branch 'origin/master' into keeper-storage-bench 2026-06-01 20:49:58 -07:00
Michael KolupaevandClaude Opus 4.7 392b35c425 keeper-bench: add KeeperStorage-only benchmark mode
New `--storage` flag switches keeper-bench into an in-process mode that exercises
`KeeperStorage` directly, without the rest of the keeper server (no network, no
raft, no state machine).

Threading model mirrors a simplified Keeper commit path:
  * N generator threads (`--concurrency`, default 4) produce requests using the
    existing `Generator` (so `setup` + `generator` config is reused).
  * One "preprocess" thread calls `preprocessRequest` for every write (stands in
    for the path that, in real keeper, runs under `raft_server::lock_`).
  * One "commit" thread calls `processRequest` for writes. After each committed
    write, with probability `1/writes_per_read_batch` it drains the pending read
    queue and processes it in one `processLocalRequests` batch.

Inter-thread queues are `NonblockingBoundedQueue` (copied from commit
6a91c30115) with 100µs polling — no condition
variables. The preprocess->commit queue has a small configurable bound
(`storage.preprocess_commit_queue_size`, default 32).

Periodic reports include (for the period): committed writes/s and reads/s,
preprocess / commit-write / commit-read thread utilization, znode count, RSS,
snapshot-mode flag, and per-op-num average preprocess/process ns and ns-per-
list-name.

Every `storage.snapshot_toggle_periods` periods the runner toggles
`enableSnapshotMode`/`disableSnapshotMode` + `clearGarbageAfterSnapshot`, so the
snapshot overhead shows up in the timings.

Refactoring: `Generator`/`PathGetter` previously took a `Coordination::ZooKeeper
&` to resolve `children_of` paths. They now take a `ListChildrenFn` callback;
the existing Runner passes a lambda wrapping the ZooKeeper client, the new
StorageRunner passes a lambda that calls `KeeperStorage::processLocalRequests`.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-18 15:36:53 -07:00
Michael Kolupaev 98090a3b08 keeper-bench: increase default znode name length 2026-04-12 15:55:44 -07:00
Michael Kolupaev 8c953c5a05 Style 2026-04-10 13:22:17 -07:00
Michael Kolupaev 732b64eac0 Generator init fix, review comments 2026-04-10 13:05:57 -07:00
Michael Kolupaev 44f01a4ede Tags 2026-04-08 14:20:34 -07:00
Michael Kolupaev 8ecf6cbdda Fix preexisting typo 2026-04-08 01:07:30 -07:00
Michael Kolupaev 341ea70496 Fix watches inside multi 2026-04-08 00:51:01 -07:00
Michael Kolupaev 19a5e151f6 keeper-bench: watches 2026-04-04 20:03:23 -07:00
Michael Kolupaev 0e75ba56e2 Count requests slightly more carefully 2026-03-25 13:19:15 -07:00
Antonio AndelicandClaude Opus 4.6 793589c920 Fix style check and seed collision in MultiRequestGenerator
Add `// Ok` comments to `catch (...)` blocks in `Runner.cpp` that handle
exceptions via `handle_request_exception` (which logs and counts errors)
but were flagged by the `catch_all` style check.

Fix seed collision in `MultiRequestGenerator::setSeedImpl`: the inner
`RequestGetter::setSeed` distributed sub-seeds as `seed + i + 1`, which
collided with siblings assigned by the outer `RequestGetter` using the
same scheme. Use a large prime offset (500009) to separate the inner
seed namespace.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98906&sha=latest&name_0=PR

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-08 22:27:24 +01:00
Antonio AndelicandClaude Opus 4.6 3f7d286d68 Seed all RNGs from generator.seed for full reproducibility in keeper-bench
Previously only `CreateRequestGenerator::rng` was seeded from the
configured seed. Four other RNGs — in `NumberGetter::getNumber`,
`StringGetter::getString` (via `generateRandomString`),
`PathGetter::getPath`, and `RequestGetter::getRequestGenerator` —
used independent `thread_local pcg64(randomSeed())` instances,
making runs non-deterministic even with a fixed seed.

Replace all `thread_local` RNGs with per-instance `mutable pcg64`
members and propagate the seed through the full generator hierarchy:
`Generator` → `RequestGetter` → each `RequestGenerator` subclass →
their `PathGetter`, `StringGetter`, and `NumberGetter` members.
Each component uses a distinct sub-seed offset to avoid correlation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-06 13:34:11 +01:00
Antonio AndelicandClaude Opus 4.6 17344a6d17 Improve keeper-bench with pipelining, warmup, per-op stats, and reproducible seeds
- Add `pipeline_depth` and `queue_depth` settings to allow asynchronous
  in-flight requests per consumer thread, hiding round-trip latency
- Add `warmup_seconds` to discard early stats while caches warm up
- Add `generator.seed` for reproducible workloads
- Track per-operation-type stats (Create, Remove, Get, Set, List, Multi)
  in both stderr reports and JSON output
- Add `on_failure_callbacks` to clean up pending paths on failed creates
- Replace `paths_created` set with O(1) swap-and-pop vector+index structure
  for random path removal
- Fix `static` → `thread_local` for RNG instances to avoid data races
- Fix `continue_on_errors` → `continue_on_error` (match actual config key)
- Validate `remove_factor` range, zero weights, and empty path getters
- Add retry limit for unique path name generation
- Simplify `removeRecursive` and deduplicate default ACL construction
- Document all new settings in README

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-06 10:32:03 +01:00
Antonio Andelic f9f786eb11 Fix remove_factor in keeper-bench 2026-02-17 15:53:46 +01:00
Nikolay Degterinsky baf8ba119a Fix tidy 2026-01-26 11:59:54 +00:00
Raúl Marín d6ac63c8d2 Style: Forbid the use of quotes for includes (partial) 2025-06-24 13:20:10 +02:00
Nikita Mikhaylov dc7bc42223 Moved some of utils to programs 2024-12-09 21:35:31 +00:00