Repository navigation
engines-external: ClickHouse adapter, the clickhouse lane, and conformance on a real server - #263
Merged
Merged
Conversation
zzylol
force-pushed
the
bench-external/run-slice
branch
from
November 17, 2026 16:46
af7fa57 to
671d399
Compare
zzylol
force-pushed
the
engines-external/clickhouse-adapter
branch
3 times, most recently
from
November 17, 2026 18:37
ef51665 to
d483622
Compare
zzylol
force-pushed
the
bench-external/run-slice
branch
from
November 17, 2026 20:13
31a0040 to
7c0d121
Compare
zzylol
force-pushed
the
engines-external/clickhouse-adapter
branch
from
November 17, 2026 20:13
d483622 to
c9e5042
Compare
…ne, restacked on system-bench #263's six commits (6161dff, f1468e0, ac7d4b3, 831eca4, 965f710, c9e5042) rebuilt on main as one change: - the adapter lives in system-bench/src/engines_external/clickhouse_server.rs, and aqpbm-cli depends on system-bench, passing the planeval feature through; - it follows main's names: benchmark-external, --engine, --run-directory, run_engine, EngineRunSetup, RunDirectory, least_common_multiple and the spelled-out fixture names; - the server's cgroup is read over SSH, as main's harness does (decision D3 of #267), not through the HTTP agent: ClickHouseServer holds a CgroupSource, the clickhouse engine takes --server-cgroup-directory and --server-ssh-host (omitted: read on this host), and scripts/extbench-up.sh no longer starts an agent; - the capabilities README change is left for step 11 of #267. Co-Authored-By: zz_y <zeyingz@umd.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… restack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc
force-pushed
the
engines-external/clickhouse-adapter
branch
from
November 24, 2026 21:58
c9e5042 to
49e13e2
Compare
GordonYuanyc
added a commit
that referenced
this pull request
Nov 24, 2026
…trics engine, restacked on system-bench #265's ten commits (2aa86b2 .. 5c7a511) rebuilt as one change on the ClickHouse restack (#263), since both add an engine to the same command: - the adapter lives in system-bench/src/engines_external/victoriametrics_server.rs; - it follows main's names (benchmark-external, --engine, --run-directory) and the spelled-out fixture and golden names; - decision D3 of #267: no HTTP agent. The server's cgroup is read over SSH or on this host (CgroupSource), and its -streamAggr.config file is replaced the same way: CgroupSource::replace_file_on_server_host writes a temporary file and renames it, locally or over main's shared SSH connection, before the HTTP reload. The victoriametrics engine takes --server-cgroup-directory, --server-ssh-host and --victoriametrics-stream-aggregation-config, and scripts/extbench-up-victoriametrics.sh no longer starts an agent and prints the config path; - #265's aqpbm-core changes served only the agent and are left out; - the replacement checks the written length before the rename, never follows a link at the temporary path, and removes the temporary file on failure; - RunArgs is boxed in the command enum (clippy large_enum_variant). Co-Authored-By: zz_y <zeyingz@umd.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc
marked this pull request as ready for review
November 24, 2026 23:03
GordonYuanyc
added a commit
that referenced
this pull request
Nov 25, 2026
…trics engine, restacked on system-bench #265's ten commits (2aa86b2 .. 5c7a511) rebuilt as one change on the ClickHouse restack (#263), since both add an engine to the same command: - the adapter lives in system-bench/src/engines_external/victoriametrics_server.rs; - it follows main's names (benchmark-external, --engine, --run-directory) and the spelled-out fixture and golden names; - decision D3 of #267: no HTTP agent. The server's cgroup is read over SSH or on this host (CgroupSource), and its -streamAggr.config file is replaced the same way: CgroupSource::replace_file_on_server_host writes a temporary file and renames it, locally or over main's shared SSH connection, before the HTTP reload. The victoriametrics engine takes --server-cgroup-directory, --server-ssh-host and --victoriametrics-stream-aggregation-config, and scripts/extbench-up-victoriametrics.sh no longer starts an agent and prints the config path; - #265's aqpbm-core changes served only the agent and are left out; - the replacement checks the written length before the rename, never follows a link at the temporary path, and removes the temporary file on failure; - RunArgs is boxed in the command enum (clippy large_enum_variant). Co-Authored-By: zz_y <zeyingz@umd.edu> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc
added a commit
that referenced
this pull request
Nov 25, 2026
…trics engine, restacked on system-bench (#265) #265's ten commits (2aa86b2 .. 5c7a511) rebuilt as one change on the ClickHouse restack (#263), since both add an engine to the same command: - the adapter lives in system-bench/src/engines_external/victoriametrics_server.rs; - it follows main's names (benchmark-external, --engine, --run-directory) and the spelled-out fixture and golden names; - decision D3 of #267: no HTTP agent. The server's cgroup is read over SSH or on this host (CgroupSource), and its -streamAggr.config file is replaced the same way: CgroupSource::replace_file_on_server_host writes a temporary file and renames it, locally or over main's shared SSH connection, before the HTTP reload. The victoriametrics engine takes --server-cgroup-directory, --server-ssh-host and --victoriametrics-stream-aggregation-config, and scripts/extbench-up-victoriametrics.sh no longer starts an agent and prints the config path; - #265's aqpbm-core changes served only the agent and are left out; - the replacement checks the written length before the rename, never follows a link at the temporary path, and removes the temporary file on failure; - RunArgs is boxed in the command enum (clippy large_enum_variant). Co-authored-by: GordonYuanyc <gordonyuanyc@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
bench-externalhas no ClickHouse lane, so a planner plan cannot run on a ClickHouse server. Example: the showcasesum by (job) (sum_over_time(latency[1m])), every 10 s over 1,000 series, planned withcapabilities/clickhouse.equivalent-only.json. engines-external: read an ASAPPlanner plan file and translate it to ClickHouse views #260 can translate that plan to SQL, but nothing installs the SQL on a server, feeds it the harness's data, or reads the server's CPU and memory.ClickHouseEngine, anEngineUnderTestthat talks to a ClickHouse server over HTTP. Each install translates its plan file into a fresh database.clickhouselane:approxbench bench-external run --lane clickhouse --clickhouse-url URL --cgroup-agent-url URL.scripts/extbench-up.sh, which starts the server: a checked binary in a pinned container on given cores, with the cgroup agent beside it.clickhouselane and match thefakelane exactly in the report (0 missing points, 0 extra points, error 0). Every README row's conformance case passes on ClickHouse 26.8.39.13.Review guide
bench-external/run-slice). Draft.c7a36bb: the failing tests (the module, the lane and the script did not exist yet);f9b5ae8: the implementation;61853a1: the fixes from the independent implementation review.aqpbm-engines-external/src/clickhouse_server.rs:ClickHouseEngine::install,ClickHouseArm::ingest/evaluate,parse_answer,Http::run. Thenscripts/extbench-up.sh.aqpbm-cli/src/bench_external_cmd.rs; theSourceTableandstored_tablesoutputs of the translator; the two planner-written probe plans (tests/fixtures/plans/REV).How the adapter runs an arm
CREATE DATABASE bench_<pid>_<n>, then the translated tables and views withdatabase=<db>INSERT … SETTINGS input_format_null_as_default = 0, insert_null_as_default = 0 SELECT … FROM input(…) FORMAT TabSeparatedwith the chunk's rows in chunk orderparam_t=t,max_threads=<n>(1 by default),FORMAT TabSeparatedWithNamessystem.partsbytes of the view tables and of the source tablesDROP DATABASE … SYNCwait_end_of_query=1, so a mid-answer exception (e.g. thethrowIfon an evaluation time that is not a window end) is an error, andmax_execution_time.__name__kept, as the harness keys answers); an aggregated answer by its label columns, empty ones left out (as PromQL leaves out an empty label).tsorvalue;CpuAccounting::Cgroup).elapsed_nsandmemory_usage. Soengine_reported_cpu_nsisNone.scanned_bytesis the summedread_bytes.Conformance on a real server
The server was started with
scripts/extbench-up.sh(cores 2 and 22, one physical core, NUMA node 0; agent on another core). The tests ran from the driver host over the private network:cargo test -p aqpbm-engines-external --test clickhouse_conformance -- --ignored --test-threads 1, 13 of 13 passed.stored_sum_count_min_maxstored_rate_is_promql_minus_the_first_value_after_each_reset, three installs fed in turn, max_threads 1 and 16query_time_rate_is_promqlAggregategrouped_sums_quantiles_and_aggregatesinstant_selectortop_k_ties_and_nanProject,BinaryOpaverage_as_sum_over_count_and_checked_divisionclass_c_rows_are_refusedquery_time_rate_is_promql,storage_and_retentionthe_harness_conformance_kit_passesthe_server_is_the_pinned_binaryOther measurements:
the_clickhouse_lane_matches_the_fake_lane, warm-up 1, 3 runs): both probe workloads Ran, with 0 missing points, 0 extra points and error 0. Query CPU was about 6–8 ms per evaluation on the server's cgroup, against 0.009 ms for the in-process fake.suite_sized_workload): 1,000 series, 1 s samples, 10 min from 1,700,000,000,000 ms; 60 inserts of 10,000 rows and 55 evaluations in 10.3 s wall time, using 3.3 s of server cgroup CPU. The answers equal the per-job sums computed in the test, and the server was never throttled.Start script
config.d. Checked:display_nameand the logger level did not change. Settings are therefore--key=valueoverrides.LISTEN_HOSTthat is not private or loopback (0.0.0.0 and public addresses; tested);AGENT_CORESpins it.Interfaces
Design scope
aqpbm-engines-external/src/clickhouse_server.rsSourceTable,stored_tablesscripts/extbench-up.shNot in this PR
system.query_logread after the arm, and the harness has no after-arm hook yet.Verification
cargo test -p aqpbm-engines-external -p aqpbm-cli: all pass.cargo clippy -p aqpbm-engines-external -p aqpbm-cli --all-targets -- -D warnings: clean.cargo fmt --all --check: clean.