Skip to content

Skip only never-run master commits when looking for the relocation headroom baseline - #131700

Merged
Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:relocation-headroom-skip-only-never-run-master-commits
Nov 18, 2026
Merged

Algunenano merged 1 commit into
ClickHouse:masterfrom
groeneai:relocation-headroom-skip-only-never-run-master-commits

Conversation

@groeneai

@groeneai groeneai commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #126314
Related: #126736

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The Relocation headroom check of Build (amd_msan) no longer compares a pull request with an older master commit while the master parent's own build is still running.

Description

On 2026-11-14 Build (amd_msan) / Relocation headroom failed three unrelated PRs with decreased by 16.23 MiB, more than 5 MiB (#124068, #131668, #117318).

Root cause: master_baseline skipped every master commit without a job report. A master job uploads its report only when it finishes, so the parent edfbc33 (#117346, Use clang-23, -16.23 MiB), still building until 20:42Z, looked like a commit that never builds, and the PRs checked seconds earlier were compared with the commit before it and charged master's own delta. Against edfbc33 they measure 0.00 to -0.03 MiB.

Change: the walk now applies the rule of the performance delta gate (classify_missing_prev_master_run, 8b06c76). A commit without a report is skipped only when its MasterCI summary shows the job never ran there (no MasterCI run, job absent, SKIPPED). Any other status, a report without the headroom row, or a lookup error other than 403/404 stops the walk: the row reports no baseline and names the commit and status (or the existing ERROR), and such a PR success is not cached. One file, no wait.

Validation: a local replay of all 13 behind-baseline FAILs of the last 30 days against the real S3 reports. The 10 real regressions still FAIL with identical text. The 3 false reds FAIL on master's code and pass with the change when the parent is modelled as RUNNING; 36 cases in all, also covering the other job statuses, lookup errors, the label, master runs and empty chains.


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

Version info

  • Merged into: 26.11.1.2743-master (included in 26.11 and later)

…adroom baseline

`master_baseline` took the nearest commit of the run's master chain whose
`Build (amd_msan)` report existed and skipped every commit without one. A master
job uploads its report only in `post_run`, so a parent that is still building
looked like one that never builds, and the PR was compared with an older commit.
On 2026-11-14 ClickHouse#117346 (`Use clang-23`) moved the msan layout by -16.23 MiB; its
own master build ran until 20:42Z, and ClickHouse#124068, ClickHouse#131668 and ClickHouse#117318, checked a
few seconds earlier, were compared with the commit before it and failed with
exactly master's delta.

Apply the rule the performance delta gate uses for the same walk
(`classify_missing_prev_master_run`, 8b06c76): when the job report is
missing, read the commit's MasterCI summary and skip the commit only when MasterCI
never ran there, the run has no such job, or the job is `SKIPPED`. Any other
status, a report without the headroom row, or a lookup error other than 403/404
stops the walk: no baseline (the header names the commit and its status) or the
existing `ERROR`. A PR success without a baseline because the walk stopped is not
cached, since master's state is not a build digest input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f8bff39]

Summary: ❌

job_name test_name status info comment
Build profile diff ERROR

AI Review

Summary

Reviewed commit f8bff39d8d24547c6c9e52e4d63e85af137f71c8. The change prevents Relocation headroom from using an older baseline while a newer master build is pending or has no usable measurement, and prevents caching PR successes that depend on that incomplete state. No actionable findings. All 46 focused local checks passed, including exact reproduction of the three reported false failures before the fix, their corrected behavior with a modeled RUNNING parent, and preservation of real regression failures.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 1 finding), plus my own review.

# Sev Finding Verdict Evidence / action
1 ⚠️ A summary job row with a missing or null status is treated like an absent job and skipped (master_baseline) DISAGREE Result.status is a required field and every summary row is written through Result (ci/praktika/result.py:112, :509-518); 0 of 13,062 job rows in 81 real MasterCI summaries lack it. An empty status stops the walk.
2 💡 A SKIPPED "reused from cache" commit is walked past to the next older reported commit DISAGREE Unchanged behaviour, same as the perf delta gate; on real reports the delta at that baseline matches the one at the parent (-7.05 vs -7.02 MiB).

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-9:20261114-224100

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. A local replay of the check against the real S3 reports, with the parent edfbc33 in its check-time state (job report missing, MasterCI summary RUNNING), fails all 3 PRs on master's code with decreased by 16.23 / 16.23 / 16.25 MiB vs 58726cc, every run.
b Root cause explained? The baseline walk skipped every master commit without a job report. A job uploads its report only when it finishes, so a parent still building looked like one that never builds, and the PR was charged master's own layout change.
c Fix matches root cause? Yes. The skip rule is fixed (skip only when MasterCI never ran the job there, as in the perf delta gate); threshold and gate are unchanged.
d Test intent preserved / new tests added? No committed test: CI infrastructure change, validated locally (no tests for test infrastructure). The 10 real behind-baseline regressions of the last 30 days and an i = 0 hit still FAIL with identical text.
e Both directions demonstrated? Yes. False reds: FAIL before, OK no master baseline: Build (amd_msan) of master edfbc33b1ad3 is RUNNING after. Real regressions: FAIL before and after.
f Fix is general across code paths? Both lookups (job report, workflow summary) go through one helper with the same 403/404 and error handling; a lookup error now stops the walk instead of being discarded by an older baseline.
g Fix generalizes across inputs (params/datatypes/wrappers)? Covered: every job status, absent job/summary, HTTP 403/404/500, transport errors, malformed JSON/gzip, empty and exhausted chains, PR and master runs, with and without the label (36 cases).
h Backward compatible? (maintainer-approved exception only) Yes. Only the header gains the reason when the walk stops; result ext keys are unchanged; no settings.
i Invariants and contracts preserved? A PR is compared only with the newest master commit whose newer commits provably never ran the job; master runs never fail; a success that depends on master's state is not cached.

Session id: cron:clickhouse-impl-slot-5:20261114-222900

@clickhouse-gh clickhouse-gh Bot added can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Nov 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - f8bff39

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build profile diff infra, not from this PR (it changes only ci/jobs/scripts/relocation_headroom.py): CI logs cluster outage, 8 readiness probes ended Read timed out and the job raised LogClusterNotReady: the endpoint never became ready, on 17 PRs between 2026-11-14 20:51Z and 23:52Z #129675 (ours, open)

Session id: cron:our-pr-ci-monitor:20261115-013011

@Algunenano Algunenano self-assigned this Nov 16, 2026

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@groeneai Can you check how often this happens? Because with the rate we merge things there is a chance that quite often master doesn't have this report ready for the nearest commit and we'll be skipping this check a lot

@groeneai

Copy link
Copy Markdown
Collaborator Author

I measured it on CIDB: every PR Build (amd_msan) run that computed Relocation headroom since 2026-10-21 (10,563 runs, cache-reused results counted once), with this PR's walk replayed against the MasterCI status of each master commit the old walk passed.

Outcome with this PR Runs
Compared against the master parent itself (unchanged) 8,635 (81.7%)
Compared against an older commit because MasterCI did not run the job on the newer ones (unchanged, same baseline) 1,728 (16.4%)
Check skipped: the walk reached a master commit whose build ran but had not reported yet 194 (1.8%)
No baseline before either 6

The skipped share is 2.5% since 2026-11-11 (77 of 3,079), and the worst day was 2026-11-17 with 40 of 425 (9.4%). A skipped run is not cached, so the next run of that build checks again.

In those 194 runs the old fallback to an older commit caught nothing real: 190 were OK, and the 4 FAILs are the false reds this PR fixes (3 on 2026-11-14 after the clang-23 merge, and one today, report, 7 commits behind). The 10 real FAIL runs measured against an older commit stay FAIL: each one passed only commits where MasterCI did not run the job.

The missing report is usually minutes away: it landed a median 0.5 min after the PR's build job ended, and 176 of the 194 within 10 minutes. If 2% (up to 9% on a busy day) is too often, I can make the check wait up to 10 minutes for a parent build that is still running, instead of skipping. Do you want that in this PR?

@Algunenano

Copy link
Copy Markdown
Member

No, it's fine. Thanks for the info. Let's merge as is

@Algunenano
Algunenano added this pull request to the merge queue Nov 18, 2026
Merged via the queue into ClickHouse:master with commit 221f2fb Nov 18, 2026
384 of 387 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). manual approve Manual approve required to run CI 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.

3 participants