Skip to content

Pick the bugfix-validation master binary from the PR's master parent chain - #127524

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:bugfix-validation-anchor-master-binary
Oct 24, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:bugfix-validation-anchor-master-binary

Conversation

@groeneai

@groeneai groeneai commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #125817

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):

Bugfix validation now downloads the master binary of the PR's own master parent chain, so it is never newer than the test configs it is started with.

Description

No related open issue found.

Bugfix validation (functional tests, *) can fail at Start ClickHouse Server: the downloaded master binary exits with code 36 three times and the changed tests never run. Example: #127364, amd64. On 2026-10-22 this hit 14 runs on 7 PRs, all re-runs after the can be tested label.

Root cause: find_master_builds walks master_commits, the raw commits?sha=master listing that Config Workflow fetches when it runs. A re-run runs Config Workflow again, so the listing is the current master, while the checkout and tests/config stay those of the original merge commit. In the example the tree is master b212e420 (before #125817) and the binary is 4558eb8f (after it), which rejects the tree's 1Mi SLRU cache disk in storage_conf_03517.xml at startup (max_file_segment_size ... must not exceed the size of each SLRU queue, BAD_ARGUMENTS).

Change: in the public repository walk master_track_commits_sha, the first-parent chain from the merge commit's master parent that is already stored for every PR and used by the performance, build-profile diff and coverage jobs. Like them, there is no fallback to the unanchored listing. Synced private PRs keep master_commits.

Validation (local, no harness test): with the failing runs' real kv data the old code picks a binary outside the PR's chain and the new code picks its master parent (both arches, 3 PRs); fail-closed, partial-build and private-repo cases checked. On the real binaries, 4558eb8f with the old config exits 36 with the message above, while b212e420 with the same config, and 4558eb8f with #125817's config, start. Already-red PRs keep their old merge commit and need a new push.


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

Version info

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

…chain

`find_master_builds` walked `master_commits`, the raw `commits?sha=master`
listing that Config Workflow fetches when it runs. A re-run (for example
after the `can be tested` label lands hours after the PR event) runs Config
Workflow again, so the listing is the current master, while the checkout,
`tests/config` and `ci/` stay those of the original merge commit. The
downloaded binary can then be newer than the tree it is started with. After
ClickHouse#125817 added a startup check that a filesystem cache's
`max_file_segment_size` fits each SLRU queue, such binaries exit with
BAD_ARGUMENTS on the older trees' 1Mi cache disk
(`tests/config/config.d/storage_conf_03517.xml`), and the changed tests
never run.

In the public repository walk `master_track_commits_sha` instead: the
first-parent chain from the merge commit's master parent, already stored
for every PR and used by the performance, build-profile diff, coverage and
parser-memory jobs. The binary is then the newest built master commit that
the tested tree contains. Like those jobs, it does not fall back to the
unanchored listing: a chain without a built commit fails the job. Synced
private PRs keep `master_commits`, because their own master commits have
no public builds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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; 1 full pass, no fix round needed).

# Sev Finding Verdict Evidence / action
1 💡 Docstrings and caller comments outside the diff still say master-HEAD / master_commits (bugfix_validation.py:20,65, functional_tests.py:806-808, integration_test_job.py:1801-1803, job_configs.py:978-992) AGREE, noted-not-blocking Wording only; the changed function's docstring and comment state the new selection rule. I kept the diff to the selection itself.

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

Session id: cron:clickhouse-review-slot-8:20261023-004400

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With #127364's recorded kv data the old find_master_builds returns 4558eb8f, and that binary with the tree's cache config exits 36 on every start (3/3 in CI, every local start).
b Root cause explained? A re-run fetches the current master listing again, while the checkout and tests/config stay at the original merge commit, so the binary is newer than the configs; #125817's SLRU check rejects the old 1Mi cache disk at startup.
c Fix matches root cause? Yes. The binary is now chosen from the tested tree's own master parent chain, so the binary is never newer than the tree; no retry, skip or inconclusive masking.
d Test intent preserved / new tests added? Test-infrastructure change: no harness self-test (per #119766); validated locally, no test file touched.
e Both directions demonstrated? Yes. Old vs new selection on the same input (old: outside the chain, new: master parent, 3 PRs, both arches); old pick + old config exits 36, new pick + identical config starts.
f Fix is general across code paths? Both callers (functional and integration bugfix validation) share the function; unit-test bugfix validation already builds from the merge base; the other "master for a PR" consumers already use the same chain.
g Fix generalizes across inputs (params/datatypes/wrappers)? Checked: amd64 and aarch64 build sets, chain absent or empty (fails closed), 100 unbuilt commits, a partial build set (skipped), private repository (unchanged pick).
h Backward compatible? (maintainer-approved exception only) Yes. Fresh events get the same binary in 11 of 12 sampled passing runs (otherwise the PR's own master parent); synced private PRs are unchanged; no settings or format surface.
i Invariants and contracts preserved? The function still returns the URLs of one fully built commit or None, handled by the callers' existing assert; new invariant: in the public repository the binary is never newer than the tested tree.

Session id: cron:clickhouse-impl-slot-5:20261023-003400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @maxknv @leshikus, could you review this and add the can be tested label so CI runs? A re-run makes Config Workflow refetch the current master listing while the checkout keeps the original merge commit, so bugfix validation started a master binary newer than the tree's test configs (exit 36 since #125817); it now walks the PR's own master parent chain master_track_commits_sha, as the performance and coverage jobs do.

@clickhouse-gh

clickhouse-gh Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3f137c3]

Summary: ✅


AI Review

Summary

PR #127524 anchors public bugfix-validation binaries to the tested tree's master-parent history while preserving private-repository behavior. No actionable findings.

Final Verdict

✅ Approve

@alexey-milovidov alexey-milovidov self-assigned this Oct 23, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 23, 2026
Merged via the queue into ClickHouse:master with commit c0302c2 Oct 24, 2026
526 of 528 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 24, 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). 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