Repository navigation
Judge a master_head performance shard by its own report when CIDB or the dashboard does not answer - #125734
Conversation
…hboard does not answer In `master_head` mode `main` turned every `PerfDashboardError` into a failure, and nothing told an outage of CIDB or of the dashboard from a defect of the job. On ClickHouse#116101 at 3b7362d, 5 of 12 shards failed during the 2026-10-13 CIDB outage although every shard report found 0 slower queries. - `CIDBCluster.last_unavailable`: the last failed call met a transport error, an answer without `X-ClickHouse-Exception-Code` (not from the server), or the server's own-load code 202 (also 241 for the `SELECT 1` probe; an INSERT can exceed a memory limit by itself). `last_rejected` and the retry decisions are unchanged. - `insert_into_cidb` tags a budget-spent reason with that, and an upload that never started; the gate counts the missing inputs as unavailable only when a classified outage spent the budget. - `dashboard_api_get` raises `PerfDashboardUnavailable` for transport errors, a gateway 502/503/504, a 404 with the backend's `code = NotFound`, and the measured outage messages `connect: connection refused` and `context canceled`. At the deadline the gate raises the class of the last reason, so a persistent wrong answer still fails. - On `PerfDashboardUnavailable` the shard is judged by its own summary: any slower query fails it (the gate exists because "more than 10 slower" passed a single +2225% query in ClickHouse#120176). An invalid summary still fails. - `/confidence` is retried until the deadline (a single HTTP 500 failed a shard on ClickHouse#124320). - `insert_historical_data` no longer prints its TSV twice: on amd 1/6 that took 15 of the last 17 s of the budget. Requested in ClickHouse#116101 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `CIDBCluster._record_http_error`: only a 5xx can mean CIDB did not answer. A 408 or 429 without `X-ClickHouse-Exception-Code` comes from a proxy (the server sends 408 only with code 159 and never sends 429); it is still retried, but no longer turns a shard green. - `dashboard_list`: `items`, `testTimes` and `slowdowns` of a dashboard answer must be lists (the live API returns `[]` when empty). A 200 without them was read as "not served yet" (fallback at the deadline), as no slowdowns (green), or raised a raw `TypeError` for `null`; it is now a plain `PerfDashboardError`. - `dashboard_api_get`: `http.client.IncompleteRead` (a connection dropped mid-body) is a transport failure, and reading the body of an HTTP error is guarded, so neither escapes as "Failed to parse the report."; an unreadable error body counts as unavailable only for a gateway 502/503/504. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…B error into the fallback - `insert_into_cidb` and the poll loop of `perf_dashboard_gate` classified a failure by its LAST attempt only, so a server verdict (a 500 with code 497, an unknown 5xx, a 400, a router 404, a malformed answer) followed by an outage reached the fallback. They now keep the first hard error: the reason or error is plain (naming the earlier error) unless every failed attempt was "did not answer"; a later success still wins. - The row fields the gate reads are validated before their absence is interpreted: an `items` row needs `identity.newSha`/`runId`, a `testTimes` row a `title`, and every `slowdowns` row `arch`, `metric`, `test`, an integer `queryIndex` and a `confidence.tier`. A row without them was read as "not served yet", filtered out, or as the non-blocking tier `unknown`; it is now a plain `PerfDashboardError`. Every live row carries them; the tier vocabulary stays open. - `dashboard_api_get`: an HTTP error whose body is cut short is a transport failure (`PerfDashboardUnavailable`) whatever the status, as a 200 cut short already is; a complete error body keeps its classification. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…west one `dashboard_run_id` sorts the runs of a sha by `identity.runTime`, so an item without a non-empty string `newSha`, `runId` or `runTime` is now a malformed answer instead of letting an older run of the same sha be judged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; r1 3 findings, r2 3 findings, r3 1 finding, r4 none) plus my
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261014-034900 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20261014-022900 |
|
Workflow [PR], commit [7307c73] Summary: ❌
AI ReviewSummaryPR #125734 lets Final VerdictStatus: ✅ Approve. |
|
cc @egor-click @maxknv, could you review this? When CIDB or the dashboard does not answer (transport error, 5xx without |
alexey-milovidov
left a comment
There was a problem hiding this comment.
I think it's ok. I see no other way to handle this.
CI finish ledger - 7307c73Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20261015-023006 |
e0d54e8
Related: #116101
Related: #120927
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
Asked in #116101 (comment).
On #116101 at
3b7362d6, 5 of 12Performance Comparison (*, master_head, N/6)shards failed although each shard's own comparison found 0 slower queries (amd 1/6, arm 1/6). Their uploads ran during the 2026-10-13 CIDB outage, so the dashboard had no data, andmainturns everyPerfDashboardErrorinto a failure.Changes:
CIDBCluster.last_unavailable: a transport error, a 5xx withoutX-ClickHouse-Exception-Code, or code 202 (and 241 for theSELECT 1probe), classified on that header likeLogCluster.PerfDashboardUnavailablefor transport errors (also an answer cut short), a gateway 502/503/504, a 404code = NotFound, and the two backend-outage 5xx messages seen so far.slowerquery fails it. The dashboard replaced a "more than 10 slower" rule that passed a single +2225% query (Join reordering: FK->PK heuristic for equi joins without NDV statistics #120176); "more than 0" still catches it. A 4xx, an unknown 5xx, a missing secret or a malformed answer still fails the shard, also when CIDB or the dashboard stops answering after it./confidenceis retried until the deadline; one HTTP 500 from it failed a shard on Unified cardinality estimation across join order, distributed and Cascades planners #124320.insert_historical_datano longer prints its 254k-line TSV twice: on amd 1/6 that took 15 s and the budget ran out right after CIDB came back."Too long" tests do not fail a shard: on that commit amd 2/6 passed with
5 too longand amd 3/6 failed with none.Trade-off while the dashboard is down (14 days of CIDB): 3% of green PR shards had a
slowerquery and would fail; 16% of dashboard-blocked shards had none and would pass.Validation: a local harness with fake CIDB and dashboard servers, 151 cases on master and on this branch, and 18 code mutations that it catches.
Workflow [PR]
Sync PR [sync-upstream/pr/125734]
Version info
26.10.1.2481-master(included in26.10and later)