Repository navigation
Update the cluster percentile warning when the topology grows - #878
Conversation
With --cluster-mode --rate-limiting, the up-front percentile warning (#386) took its sample bound from the first committed topology only. Since #799 a run can start on a partial slot map, and when the map heals memtier opens more endpoint connections, each with its own rate limit. On a 3-primary cluster with one primary's slots removed and restored 1 s into a 6 s run at 800 req/s, memtier warned that p99.99 "records at most about 9664" and "will not be resolved", then recorded 10187 samples and resolved it. The window warning's promise that the win<N>s row marks a percentile with '*' could break the same way. The cluster client now publishes the largest fan-out it has committed, not the first one. The main thread checks it once per tick, as before, and when it grows prints the warnings again with the raised bounds, under a "the cluster topology grew to N rate-limited connections" line. A raised bound only removes warnings, so an update revisits only the percentiles already warned about: each gets the new bound, or a note that it may now be resolved (by the run or by the window). A run warning that becomes a window warning gets both. A --requests bound does not depend on the connections and is not repeated. The update is printed once per growth, on the main thread's tick and not on the request path, and the last tick runs after the workers end, so it sees the final topology. The fan-out is written only under the topology summary's mutex, so the compare-and-store does not race between workers. The warning is stderr-only; no JSON or report field carries the bound. Rewording the message to "with the initial topology" would document the gap, but the run could still warn that a percentile cannot be resolved when it can, with nothing to correct it. The two tests run a fake cluster that heals only after memtier has printed its first warnings, so the update is deterministic. They check the exact warning lines, that every win1s row marks the percentiles still warned about, and that a --requests bound is not repeated. Fixes #825 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks for this. I went through the update logic in Both tests fail on master, and they wait until the first warnings have printed before the cluster heals, so they don't rely on sleeps. That's the kind of fails-then-passes regression test that was already accepted in #364. Since this only touches stderr and doesn't change any JSON or report field, I don't see a compatibility problem. Printing the trailing newline only when there's a warning is a small improvement. Nitpicking: when an update only withdraws warnings (every revisited percentile turns into a Since this sits in the cluster refresh path next to #877, it may be worth a second look from whoever owns cluster routing. Otherwise this looks good to merge from my side. (would file this as an approval-leaning comment, not a block) |
|
Review summary for c8c4af1. All 7 lenses approve (semantics, output, tests, lifecycle, interactions, maintainability, build).
On the |
Fixes #825.
Problem
With
--cluster-mode --rate-limiting, the up-front percentile warning (#386) took its sample bound from the first committed topology only. Since #799 a run can start on a partial slot map, and when the map heals memtier opens more endpoint connections, each with its own rate limit, so the run can record more samples than the warning said it could.Reproduction
3-primary OSS cluster with
cluster-require-full-coverage no, slots 10923-16383 removed and then restored mid-run,-t 1 -c 1 --rate-limiting 800 --test-time 6 --print-percentiles 99.99:p99.99 needs at least 10000 latency samples, but this run records at most about 9664, so it will not be resolved.the cluster topology grew to 3 rate-limited connections, so the percentile sample bounds above are raised:andp99.99 ... may now record up to about 14496, so it may be resolved.Change
--requestsbound doesn't depend on connections, so it isn't repeated.*marker already uses each row's real count. The progress-line newline is now printed only when there is a warning; master printed it even when there was nothing to warn about.Rewording the message to "with the initial topology" was the smaller option. I didn't take it because the run would then still say a percentile "will not be resolved" when it is, with nothing to correct it.
Tests
tests/test_cluster_unowned_slots.py, built on the Keep cluster workloads progressing across partial maps and primary reconnects #799 fake cluster.*mark on every window row, and that a--requestswarning isn't repeated.test_realtime_latencies.py: 34/34 standalone.test_realtime_latencies.pyon a 3-shard cluster: 9/9.make check: 18/18.Affected versions
Introduced in 9bf3960 (#386), which is unreleased. It interacts with #799 (4018396), also unreleased.
🤖 Generated with Claude Code
Note
Low Risk
Changes stderr warnings and cluster connection accounting for percentile checks only; benchmark routing, rate limiting, and reported latencies are unchanged.
Overview
Fixes misleading unresolvable percentile warnings in cluster mode when a partial slot map heals and memtier opens more rate-limited endpoint connections (#825).
The cluster client now keeps the largest rate-limited connection fan-out seen across topology commits (not only the first). The main progress loop re-runs
warn_unresolvable_percentileswhenever that count grows: it prints a short header, re-issues warnings with raised bounds, or notes when a percentile may now be resolvable.--requestsbounds are unchanged by connection growth, so those run-level warnings are not repeated. Progress-line newline handling is tightened so it only runs when something is actually printed.README documents the follow-up warnings. Integration tests simulate a healing partial
CLUSTER SLOTSmap and assert the exact warning/note sequence and window*markers.Reviewed by Cursor Bugbot for commit c8c4af1. Bugbot is set up for automated code reviews on this repo. Configure here.