Skip to content

Perf CI: gate the check on the performance dashboard's confirmed regressions - #120927

Merged
fm4v merged 1 commit into
masterfrom
perf-ci-dashboard-gate
Sep 19, 2026
Merged

fm4v merged 1 commit into
masterfrom
perf-ci-dashboard-gate

Conversation

@fm4v

@fm4v fm4v commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

A master_head performance shard failed only when more than 10 queries were slower, so a single large regression passed. #120176 was merged green while tpcds query 71 went from 0.24 s to 5.67 s (+2225%) on arm: the shard reported 1 slower, and the performance dashboard classified the same row as confirmed_regression: https://performance.ci.clickhouse.com/runs/pr-120176-a42ceaeced57aba347467f9940f33abe4fb50388

The dashboard computes a run from the tables this job uploads in the REPORT stage and judges every changed query with a confidence tier built from the raw per-run samples of both sides, the quantile shift, and the recent master history of that query. This PR makes that verdict the gate in master_head mode:

  • after the CIDB uploads, the job waits until the dashboard serves this shard's data (the /runs/<run>/tests/<test> detail lists this arch), then fetches /runs/<run>/confidence?metrics=client_time;
  • slowdown rows of this shard and arch with tier confirmed_regression fail Check Results and are added to it as failed rows linking the dashboard's query page (likely_regression and noise rows are only logged);
  • if the dashboard does not answer within ten minutes, the check fails with the reason instead of passing an unjudged run;
  • run errors still fail the check as before; local runs skip the gate.

The release_base mode keeps its delta gate on slower counts: that comparison is cumulative since the release branch point and is not what the dashboard's runs describe.

Checked against the live API with a throwaway script: the arm shard of PR 120176 yields exactly tpcds #71 and tpcds #58 as blocking, the amd shard 2/6 of PR 120677 yields nothing, master run ids resolve via /runs?scope=master&q=<sha>, and an unknown run fails closed after the timeout. The perf jobs of this PR exercise the wiring end to end.

Related: #120921
Related: #120176

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Workflow [PR]
Sync PR [sync-upstream/pr/120927]

Version info

  • Merged into: 26.10.1.181 (included in 26.10 and later)

…rdict

The `Check Results` status of a `master_head` performance shard failed only when more than 10 queries were "slower". A single large regression therefore passed: #120176 was merged with `tpcds` query 71 going from 0.24 s to 5.67 s (+2225%) on arm, reported as `1 slower` and green, while the performance dashboard classified it as `confirmed_regression`: https://performance.ci.clickhouse.com/runs/pr-120176-a42ceaeced57aba347467f9940f33abe4fb50388

The dashboard computes a run from the tables this job uploads in the REPORT stage and judges every changed query with a confidence tier built from the raw per-run samples of both sides, the quantile shift and the recent master history of the same query. In `master_head` mode that verdict now decides the status: after the uploads, the job waits until the dashboard serves this shard's data (the `/tests/<test>` detail lists this arch), fetches `/runs/<run>/confidence` for `client_time`, keeps the slowdown rows of this shard and arch, and fails the check when any of them is `confirmed_regression`. The confirmed rows are added to `Check Results` with a link to the dashboard's query page. If the dashboard does not answer within ten minutes the check fails with the reason instead of passing an unjudged run.

The `release_base` mode keeps its delta gate on slower counts, because that comparison is cumulative since the release branch point and is not what the dashboard's PR runs describe.

Related: #120921
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e6a5981]

Summary: ✅


AI Review

Summary

This PR switches the master_head performance gate from the legacy "N slower" threshold to the performance dashboard's confirmed_regression verdict after the REPORT-stage uploads land. The direction is right, but the new gate currently retries only run discovery/readiness and not the final confidence fetch, so a transient /confidence failure or a small lag between test-page publication and confidence computation can fail the check even though the dashboard would have answered within the advertised ten-minute window.

Findings
  • ⚠️ Majors
    • [ci/jobs/performance_tests.py:1655] perf_dashboard_gate stops waiting as soon as /runs/<run>/tests/<test> shows the shard, then calls /runs/<run>/confidence only once. If that endpoint is briefly behind or returns a transient HTTP error, the exception escapes immediately and the job fails instead of using the remaining DASHBOARD_INGEST_TIMEOUT_SEC. That makes master_head perf checks flaky and breaks the PR's own "wait for the dashboard verdict" contract.
    • Suggested fix: keep polling until the same deadline covers a successful confidence fetch, or switch to the per-test /runs/<run>/tests/<test>/confidence endpoint and keep waiting while the row is still unavailable.
Final Verdict
  • Status: ⚠️ Request changes
  • Retry the final dashboard confidence fetch until the same deadline used for shard visibility, so a transient API delay or HTTP error does not redden the perf check.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 18, 2026
print(f"Waiting for the performance dashboard: {reason}")
time.sleep(DASHBOARD_POLL_INTERVAL_SEC)

rows = fetch_dashboard_slowdowns(run_id, arch, shard_queries)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perf_dashboard_gate only retries the run lookup / dashboard_has_shard probe. Once that loop breaks, fetch_dashboard_slowdowns hits /runs/<run>/confidence exactly once.

That means a transient HTTP error there, or a short lag where the test page is already visible but the confidence view is still being computed, turns the whole master_head check red immediately even though DASHBOARD_INGEST_TIMEOUT_SEC still has budget left. This violates the PR's "wait up to ten minutes for a dashboard verdict" contract and will make the perf gate flaky.

Please keep polling until the same deadline covers a successful confidence fetch as well, or gate directly on the per-test /runs/<run>/tests/<test>/confidence endpoint and treat "no row yet" as "keep waiting".

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 18, 2026
@fm4v
fm4v added this pull request to the merge queue Sep 19, 2026
Merged via the queue into master with commit eb604ef Sep 19, 2026
176 checks passed
@fm4v
fm4v deleted the perf-ci-dashboard-gate branch September 19, 2026 10:51
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 19, 2026
This was referenced Sep 19, 2026
fm4v added a commit that referenced this pull request Sep 23, 2026
The performance image inherits `TZ=Europe/Amsterdam` from `test-base`, and the job wrote `datetime.now()` and `datetime.fromtimestamp()` into the UTC `event_date`, `event_time` and `check_start_time` columns, so every row was two hours ahead in summer. For a run that uploads after 22:00 UTC, `event_date` is the next day. The performance dashboard lists runs only up to the current UTC date, so it did not list such a master run until UTC midnight, and the dashboard gate failed the shard with `no master run for sha <sha> yet`. Every red master perf shard since #120927 started between 18:00 and 24:00 UTC.

Example: `Performance Comparison (amd_release, master_head, 5/6)` of master `8b9fd5bf05d1` started at 21:12:24 UTC per `checks`, while its `perf_test_times_v1` rows carry `check_start_time` 23:10:52 and `event_date` 2026-09-20.

The previous commit of this branch skipped the gate on master, which would have removed the only regression verdict of `master_head` on master; it is reverted.
pull Bot pushed a commit to AnotherGenZ/ClickHouse that referenced this pull request Sep 23, 2026
In `master_head` mode a master run looked up its own run on the performance dashboard and failed the check when the dashboard did not list it within 600 s (`no master run for sha <sha> yet`). About 20% of the red performance checks since ClickHouse#120927 were master runs failing this way. A master run has nothing to block, so the gate now runs only for PRs; run errors still fail the check.
pull Bot pushed a commit to Haofei/ClickHouse that referenced this pull request Sep 26, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants