Skip to content

fix(asap-tools): send ClickHouse ticks at once in the paced feeder - #835

Merged
milindsrivastava1997 merged 1 commit into
mainfrom
fix/paced-feeder-clickhouse-ticks
Oct 12, 2026
Merged

milindsrivastava1997 merged 1 commit into
mainfrom
fix/paced-feeder-clickhouse-ticks

Conversation

@zzylol

@zzylol zzylol commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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_engine from main:

Check Result
ClickHouse, 1e6 rows/s, 2 samples/s, 10 s, feeder pinned to 2 cores 0 overrun ticks, ticks 356–617 ms (about 860–1030 ms without this change)
ClickHouse, 1e4 series × 4 samples/s, 10 s 400,000 rows, unique (series, ts), 40 rows per series at 250 ms spacing; every value matches an independent Python reimplementation of the generator exactly
Remote write, same workload, engine with --allowed-lateness-ms 0 and a Sum by label_0 1 s tumbling aggregation 0 late drops (the feeder before #793's review fix: 236,000 of 400,000 dropped), 4,000 group batches of 100 samples, 1,000 windows emitted
Remote write, 1e6 rows/s at 1 and 2 samples/s, feeder pinned to 2 cores 0 overrun ticks, 0 failed requests

cargo clippy --all-targets -- -D warnings, cargo fmt --check and the 6 unit tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AnJ7LocWxguh3q4QWkCYae

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
@milindsrivastava1997
milindsrivastava1997 merged commit 328aea5 into main Oct 12, 2026
11 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the fix/paced-feeder-clickhouse-ticks branch October 12, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants