Repository navigation
Make perf CIDB metrics/history inserts best-effort - #108712
alexey-milovidov merged 1 commit into
Conversation
The Performance Comparison job opened insert_raw_query_metrics_data() and insert_historical_data() with a bare assert cidb.is_ready(). A transient LogCluster (play.clickhouse.com) timeout therefore raised AssertionError and failed the whole perf job with exit code 1, even though metrics insertion is a reporting side-effect and the perf verdict was green. These functions already treat a failed insert as non-fatal (log and return True), and CIDBCluster.do_insert_query() already calls is_ready() internally and returns False gracefully, so the top-level assert was both redundant and harmful. Replace it with the same skip-and-warn guard that insert_report_aggregates() and prepare_historical_data() already use. Add a regression test asserting no perf CIDB-insert path re-introduces a bare assert cidb.is_ready() and that every is_ready() call site is guarded. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260627-202600 |
|
cc @maxknv @leshikus — could you review this small CI reliability fix? It makes the perf job's CIDB metrics/history inserts best-effort: a transient |
|
Workflow [PR], commit [09b3c22] Summary: ✅
AI ReviewSummaryThis PR makes the Final VerdictStatus: ✅ Approve |
…-insert-best-effort Make perf CIDB metrics/history inserts best-effort
The REPORT-stage uploads of a performance shard probed CIDB once and
skipped the whole step when that probe failed ("CIDB not ready -
skipping"), and a failed INSERT was not retried either. That was fine
while the tables were informational (ClickHouse#108712), but since ClickHouse#120927 the
performance dashboard computes the master_head verdict from exactly
these tables. A CIDB refusal of seconds or an overload of minutes
therefore dropped the shard's rows, and perf_dashboard_gate then waited
600 s for data that was never sent and failed the shard with "dashboard
did not serve this shard within 600s", blaming the dashboard.
Measured: ClickHouse#113589 arm 6/6 skipped all three uploads on "Connection
refused" and failed after 614 s. On 2026-09-25 a CIDB overload
(TOO_MANY_SIMULTANEOUS_QUERIES, read timeouts) failed 70 shards on 21
PRs and master. In 74 of the 76 occurrences since 2026-09-22 that are
not the time zone shape fixed by ClickHouse#121847, an upload was skipped or
failed. The same run of ClickHouse#122252 is the control: amd 1/6 uploaded and
got its verdict in 2 s, while arm 6/6 skipped the uploads and failed.
Now one helper runs all four INSERT sites. In master_head mode the
three tables the verdict is computed from (query_metric_runs_v1,
query_metrics_v2, perf_test_times_v1) are retried every 60 s until one
600 s deadline, which is taken when the uploads start and shared with
the gate's wait. The other tables keep a single attempt, and nothing is
sent after the deadline. Every attempt carries the same
insert_deduplication_token, because some INSERTs that timed out on the
client had committed on the server. If one of the three inputs was not
uploaded, the gate fails at once and names it instead of polling the
dashboard. A shard without a verdict still fails, as ClickHouse#120927 designed,
and release_base keeps its single call.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
The
Performance Comparisonjob openedinsert_raw_query_metrics_data()andinsert_historical_data()with a bareassert cidb.is_ready(). A transient LogCluster (play.clickhouse.com)SELECT 1timeout (3s) therefore raisedAssertionErrorand failed the whole perf job with exit code 1, even though metrics insertion is a reporting side-effect and the perf verdict itself was green.Observed on PR #107236,
Performance Comparison (arm_release, master_head)shards 2/6 and 5/6:In the same run, sibling shards with comparable or worse perf annotations passed because their metrics insert succeeded:
assert cidb.is_ready()-> AssertionErrorassert cidb.is_ready()-> AssertionErrorShard 3/6 had 7 unstable and still passed, confirming "slower/unstable/too long" are informational; the perf gate only fails on
> 10slower queries (SLOWER_QUERIES_FAIL_THRESHOLD). The job's exit-1 came solely from the metrics-insert assert.These functions already treat a failed insert as non-fatal (log and
return True), andCIDBCluster.do_insert_query()already callsis_ready()internally and returns False gracefully, so the top-levelassertwas both redundant and harmful. This change replaces it with the same skip-and-warn guard already used byinsert_report_aggregates()andprepare_historical_data()in this file:Adds a regression test in
ci/tests/test_perf_slow_gate.pyasserting that no perf CIDB-insert path re-introduces a bareassert cidb.is_ready()and that everyis_ready()call site in the job is guarded.Failure report (shard 2/6): https://s3.amazonaws.com/clickhouse-test-reports/PRs/107236/15cd4c31d28e40d015ba4830937a5a8df2c9073a/performance_comparison_arm_release_master_head_2_6/report.html
Version info
26.7.1.183(included in26.7and later)