Repository navigation
feat(asap-tools): feed the sketchdb arm in the ClickHouse runner - #900
Conversation
milindsrivastava1997
left a comment
There was a problem hiding this comment.
Code review findings (Claude Code).
| experiment_modes, | ||
| yaml.safe_load(f), | ||
| minimum_experiment_running_time, | ||
| controller_prebuilt_output_dir, |
There was a problem hiding this comment.
The feed alignment just above (~652–657: the LCM of the aligned groups' intervals and the align_to_interval / query_time_offset checks) reads only experiment_modes[0]'s client config. Its comment, 'Every mode's client config has the same query timing', stopped being true once sketchdb can skip trailing groups (#899).
Example: a config with experiment: [{mode: sketchdb}, {mode: baseline}]. The LCM then covers only the structured groups. If a PromQL group has an interval no structured group has (15 s vs 10 s), baseline's feed start isn't a multiple of 15 s, and its floored eval windows start before data_start and score partial windows. An invalid offset in a group only baseline runs also passes the pre-start check. Suggest using the union of groups across all modes, or baseline's config.
There was a problem hiding this comment.
Fixed in 7866734: the alignment and aligned-group checks now read the client config of a mode that runs every group (any mode but sketchdb).
| f"?database={CLICKHOUSE_DATABASE}" | ||
| } | ||
| if query_engine_url is not None: | ||
| sinks[SINK_QUERY_ENGINE] = query_engine_url |
There was a problem hiding this comment.
In fed sketchdb runs this starts two feeder processes per metric on the measured node (engine remote-write plus ClickHouse INSERT); baseline feeds ClickHouse only. Sketchdb's monitored CPU and latency therefore include competition baseline never sees, which biases the comparison against ASAPQuery. The ClickHouse feed is needed only for forwarded queries, and the generated sketchdb arm (#901) runs only structured groups, which ASAPQuery answers itself.
Separately: this sink choice duplicates paced_feeder_sinks(mode, ...) in experiment_utils/services/paced_feeder.py, so the rule 'sketchdb also feeds the query engine' now lives in two places. Suggest reusing that helper.
There was a problem hiding this comment.
Fixed in 6c58a8b: a fed sketchdb run now feeds only ASAPQuery and sets forward_unsupported_queries: false, so it doesn't pay for a ClickHouse feeder that baseline never runs. _feed_sinks holds the choice, with tests. On the duplication: paced_feeder_sinks builds Prometheus remote-write sinks, so it isn't reused here.
| ) | ||
|
|
||
| # Start query engine (precompute + JSON ingest + ClickHouse fallback) | ||
| # Start query engine (precompute + ClickHouse fallback), ingesting |
There was a problem hiding this comment.
Stale comment: the section header above (~line 772) still says --- sketchdb mode: precompute engine + JSON ingest + ClickHouse fallback ---, which contradicts this branch setting ingest_json_config = None in fed runs.
8d9502f to
7866734
Compare
bbcdac9 to
09375f7
Compare
6c58a8b to
eee2cec
Compare
With dataset.paced_feeder, sketchdb mode now starts the engine on remote-write ingest and feeds it and ClickHouse (which answers forwarded queries) from one start and seed, then points the aligned query groups at that start, as baseline does. A fed dataset has no dataset.precompute for the planner's input, so fed sketchdb needs controller.prebuilt_output_dir. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The feed's alignment and the aligned groups' checks read the first mode's client config, which for sketchdb may lack trailing groups; they now read a mode that runs every group. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A ClickHouse copy of the feed during sketchdb only served queries ASAPQuery forwards, and loaded the node sketchdb's CPU and latency are measured on. Fed sketchdb now feeds the engine alone and forwards no unsupported queries, so an unplanned query fails instead of being answered by ClickHouse. Co-Authored-By: Claude Opus 5.5 <[email protected]>
eee2cec to
7202240
Compare
Part of #874 (2 of 3). Stacked on #899; review only its commits.
Problem:
experiment_run_clickhouse.pyrefused sketchdb withdataset.paced_feeder: its engine ingesteddataset.local_data_file, which a fed config doesn't have.Fix:
streaming.remote_write.base_port/path) instead of JSON._start_feedrecreates the tables and starts the feed to ASAPQuery only; thenset_data_start, as baseline does.forward_unsupported_queries: false. The issue proposed a shared feed so forwarded queries had data, but a ClickHouse feeder during sketchdb would load the node its CPU and latency are measured on, which baseline never pays, and the generated arm (feat(asap-tools): sketchdb arm for sketch-bench ClickHouse workloads #901) runs only planned queries. An unplanned query now fails visibly instead._feed_sinksholds this choice. Unfed (JSON) sketchdb runs still forward.flow.steady_state_wait: the aligned groups' starting delay covers it. The mode waits out the feed before syncing, so feeders write their stats.dataset.precomputeto build the planner's input from, so fed sketchdb needscontroller.prebuilt_output_dir; this is checked before ClickHouse starts. No ClickHouse discovery is used.Not covered by tests: the wiring inside
main(); it needs a real run (see #874).Tests:
tests/test_experiment_run_clickhouse.py(fed sketchdb needs a prebuilt plan; each mode's feed sinks; sketchdb's queries follow its own feed's start).🤖 Generated with Claude Code