Repository navigation
fix(asap-tools): send ClickHouse ticks at once in the paced feeder - #835
Merged
Merged
Conversation
Slot-by-slot sending is only needed for remote write, where ASAPQuery can drop samples behind a group's watermark. ClickHouse sorts on insert, and waiting between slots doubled its tick time at 2 samples/s (about 450 ms to 950 ms at 1e6 rows/s). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnJ7LocWxguh3q4QWkCYae
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #793. The review fix there made each tick send its sub-second slots one at a time, waiting for every request of a slot before sending the next, so ASAPQuery's per-group watermark never sees a group's samples out of order. ClickHouse doesn't need that ordering (MergeTree sorts on insert), and the waiting roughly doubled its tick time at 2 samples/s: about 450 ms per tick before #793's review fix, about 950 ms after it, at 1e6 rows/s.
Now only remote write sends slot by slot; ClickHouse gets the whole tick at once, as before the review fix.
Testing
On a CloudLab c6320, against ClickHouse 26.10 and
precompute_enginefrommain:(series, ts), 40 rows per series at 250 ms spacing; every value matches an independent Python reimplementation of the generator exactly--allowed-lateness-ms 0and aSumbylabel_01 s tumbling aggregationcargo clippy --all-targets -- -D warnings,cargo fmt --checkand the 6 unit tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01AnJ7LocWxguh3q4QWkCYae