Skip to content

Version-gate the silk test config so the upgrade check can start the previous release - #117172

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:gate-silk-config-on-server-version
Aug 30, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:gate-silk-config-on-server-version

Conversation

@groeneai

@groeneai groeneai commented Aug 30, 2026 •

Copy link
Copy Markdown
Collaborator

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

Install the silk test config only on servers that can parse it, so the upgrade check can start the previous release.

Description

Upgrade check (amd_release) went red on every PR from 2026-08-30 13:48Z: the previous-release
server refused to start on every attempt, so no test ran.

Code: 137. DB::Exception: Unknown elements 'enable_silk_runtime', 'silk' found in config
/etc/clickhouse-server/config.xml. ... (UNKNOWN_ELEMENT_IN_CONFIG)

tests/config/install.sh applies the current-master test configs to the previous-release server,
which is the point of the job. Line 148 symlinked config.d/silk.xml unconditionally, and that
file declares two top-level elements, enable_silk_runtime and silk, that first exist in 26.9.
A comment at the top of install.sh already states the rule the line broke: a new config must
check the ClickHouse version so it does not break validations that run a previous version.

The line landed on 2026-08-26 but only bit four days later. v26.8.1.2041-lts was published
2026-08-30T13:47:42Z, which moved previous_release_tag from 26.7 to 26.8. 26.7 has no
unknown-key validator, so it tolerated both; 26.8 has one and does not know them. A passing and a
failing run seven minutes apart build the same master package and differ only in that tag.

I gate the symlink on the installed server's version, the same way the same file already gates
http_url_prefix.xml on 26.8 for this defect class. A server that can parse the drop-in still
gets it, so the post-upgrade phase keeps its coverage.

Validated against the v26.8.1.2041-lts packages CI itself downloads: before the change the 26.8
server reproduces the error above, after it the drop-in is skipped and the server gets past config
validation on both configure flag branches, and a 26.9 binary still installs it.

A style-check rule forbidding a new ungated drop-in would guard the whole class, but it has a much
wider blast radius and there is no second offender today.

No open issue exists for this failure. CI report for a failing run:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113857&sha=6dadc6c55d0db93d36c63700720da36b81482bb4&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

Related: #112667


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

Version info

  • Merged into: 26.9.1.407 (included in 26.9 and later)

…previous release

`tests/config/install.sh` applies the current-master test configs to the
previous-release server, which is the point of the `Upgrade check` job
(`tests/docker_scripts/upgrade_runner.sh:91` installs the previous-release
packages, `:131` then runs `configure ... --previous-release`). Line 148
symlinked `config.d/silk.xml` unconditionally, and that file declares two
top-level elements, `enable_silk_runtime` and `silk`, which first exist in
26.9. A server that does not know a top-level config key rejects it with
`UNKNOWN_ELEMENT_IN_CONFIG` and refuses to start, so `Upgrade check
(amd_release)` failed on every PR run from 2026-08-30 13:48Z: every start
attempt failed and the job reported `Cannot start clickhouse-server` with no
test having run.

A comment at the top of `install.sh` already states the rule the line broke: a
new config must check the ClickHouse version so it does not break validations
that run a previous ClickHouse version.

The line was written in `c3f40eb660cf` and reached master with PR ClickHouse#112667 on
2026-08-26, but only bit four days later, because the previous release changed
under it. Measured on `src/Core/ServerSettings.cpp` per ref:

    ref     "found in config"   enable_silk_runtime
    26.7            0                   0
    26.8            1                   0
    master          1                   1

26.7 tolerated both elements because it validates no unknown top-level keys
at all; 26.8 added `ServerSettings::checkUnknownSettings` and does not know
them. Publishing `v26.8.1.2041-lts` at 2026-08-30T13:47:42Z moved what
`tests/ci/get_previous_release_tag.py` resolves to from 26.7 to 26.8. A
passing and a failing run seven minutes apart build the same master package
`clickhouse-client_26.9.1.1_amd64.deb` and differ only in
`previous_release_tag`.

Gate the symlink on the installed server's version. `check_clickhouse_version`
reads `clickhouse --version` from `PATH`, i.e. the version of the very binary
that will read the config being written, so the gate protects any invocation
with an old binary rather than only the one that passes `--previous-release`.
The literal is 26.9 because `cmake/autogenerated_versions.txt` was already at
`VERSION_STRING 26.9.1.1` two days before silk merged, `config.d/silk.xml`
does not exist on ref 26.8, and 26.8's `ServerSettings.cpp` has no
`enable_silk_runtime`. This mirrors the way the same file already gates
`http_url_prefix.xml` on 26.8 for this defect class. No release branch
installs the drop-in, so no backport is needed.

Servers that can parse the drop-in still receive it, including the
post-upgrade phase at `upgrade_runner.sh:175`, so no coverage is lost.

Validated locally against the `v26.8.1.2041-lts` packages CI itself downloads,
with no build required. Before the change the drop-in is installed and the
26.8 server reproduces `Code: 137 ... Unknown elements 'enable_silk_runtime',
'silk' ... (UNKNOWN_ELEMENT_IN_CONFIG)`. After it the drop-in is skipped and
the server reaches `Starting ClickHouse 26.8.1.2041` and the executable
integrity check before dying on an absent local MinIO with an unrelated
`Code: 499`, on both of the flag branches `configure` can take. A 26.9 binary
still installs it. `checkUnknownSettings` accumulates every unknown key before
throwing, so the pre-fix exception is an exhaustive list of what 26.8 rejects
in the real config set, and it names only these two keys.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect labels Aug 30, 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; 2 full gate passes, 5 own
findings, 1 fix round). The second gate pass returned zero findings on the published content.

# Sev Finding Verdict Evidence / action
1 ⚠️ Two-direction, package-backed proof is missing: nothing asserts the silk drop-in is still installed on the new server DISAGREE It is asserted, and I re-checked it from the run trees rather than from a summary. On a 26.9 binary the gate logs 26.9.1.1. is OK (>= 26.9) and config.d/silk.xml exists; on the official v26.8.1.2041-lts debs the job itself downloads it logs 26.8.1.2041 is too old. Required >= 26.9 and the drop-in is absent, with zero unknown-element errors and the server reaching Starting ClickHouse 26.8.1.2041 plus the executable integrity check on both flag branches configure can take. The pre-fix control has the drop-in present and fails with UNKNOWN_ELEMENT_IN_CONFIG (the only Code: value observed is 137), which arms the predicate. An official 26.9 package cannot be part of the proof because 26.9 is unreleased; the arm uses the same build the post-upgrade phase installs
2 ⚠️ The precedent citation points at the wrong line of install.sh AGREE, fixed before publication The http_url_prefix.xml gate is at install.sh:291 on the base and :296 on this branch; the cited line is an unrelated users.d/ symlink in both. Now named by file and symbol so it cannot drift with the diff
3 ⚠️ The start-attempt count is wrong AGREE, fixed before publication start_server takes max_attempt=${1:-6} and upgrade_runner.sh passes no argument, so at most 7 attempts are possible, and the cited run's application_errors.txt holds exactly 7. The count is dropped; it says nothing the failure does not
4 ⚠️ The provenance sentence paired one event's commit hash with another event's date AGREE, fixed before publication c3f40eb660cf carries author and commit date 2026-07-30; the line reached master when #112667 merged on 2026-08-26. A reviewer running git show on that hash would have seen July against a stated August. Both events are now stated separately
5 💡 The in-file rule is cited one line above where it starts AGREE, fixed before publication The comment block is install.sh:98-100. Cited without a line number now, in the commit message and in the validation-gate comment
6 💡 The rendered related-PR line used the #NNNNN shorthand rather than a full GitHub URL AGREE, fixed before publication The template asks for full URLs; the visible line now carries one
7 💡 A count in the validation-gate comment read as a number of files when it counted merge events AGREE, fixed before publication The two post-fix arms each log 95 Merging configuration file lines with every path appearing exactly once; the pre-fix arm logs none, because it throws during an earlier load. Reworded to that, which is both shorter and checkable
8 💡 Whether a randomized drop-in could hide a second offender DISAGREE Of the 13 RANDOM sites in install.sh only two select a whole file, and CI pins the first off via --no-keeper-inject-auth. The top-level elements of all three candidate files are zookeeper, auxiliary_zookeepers and storage_configuration, all of which 26.8 knows, so no coin flip can introduce a key it does not

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. No blocker was raised in either pass.

Separately confirmed from the failing job log rather than from a local reproduction: six
version gates already in this file evaluate the previous-release binary inside this very job,
all printing ClickHouse version 26.8.1.2041 is OK (>= ...), so a 26.9 literal cannot
behave differently in kind from the gates shipping beside it.

Session id: cron:clickhouse-review-slot-9:20260830-160900

@groeneai groeneai added the groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect label Aug 30, 2026
@clickhouse-gh clickhouse-gh Bot closed this Aug 30, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Aug 30, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, no build needed. Extract the two v26.8.1.2041-lts debs, put their bin first on PATH, run install.sh <dest>/server <dest>/client --no-keeper-inject-auth --no-remote-database-disk --s3-storage --previous-release, then start that binary on the produced config.d. Pre-fix it fails with UNKNOWN_ELEMENT_IN_CONFIG every run, not at some rate.
b Root cause explained? install.sh applies current-master test configs to the previous-release server. Line 148 symlinked config.d/silk.xml unconditionally; that file declares enable_silk_runtime and the silk section, which first exist in 26.9. A server that does not know a top-level config key throws UNKNOWN_ELEMENT_IN_CONFIG and refuses to start. Dormant since 2026-08-26 because 26.7 had no unknown-key validator; publishing v26.8.1.2041-lts moved previous_release_tag to 26.8, which has one.
c Fix matches root cause? Yes. It restores the rule a comment near the top of install.sh already states, at the one line that broke it, keyed on the binary that will read the config rather than on a caller flag. Not skip_check_for_incorrect_settings (that would mask the class of config incompatibility the upgrade check exists to surface) and not deleting the drop-in (that would lose coverage).
d Test intent preserved / new tests added? Preserved, no new test file. Coverage on servers that can parse the config is unchanged: the post-upgrade configure at upgrade_runner.sh:175 carries no --previous-release and still installs the drop-in, confirmed by the 26.9 arm. No harness unit-tests install.sh and none of the eight existing version gates has a test.
e Both directions demonstrated? Yes, on two oracles. Symlink: pre-fix the drop-in is installed, post-fix it is not, same commands. Server: pre-fix the 26.8 server reproduces Code: 137 ... Unknown elements 'enable_silk_runtime', 'silk' ... (UNKNOWN_ELEMENT_IN_CONFIG); post-fix zero occurrences, and it reaches Starting ClickHouse 26.8.1.2041 and the executable integrity check before dying on an absent local MinIO with Code: 499.
f Fix is general across code paths? Yes, measured. grep -rn -- "--previous-release" ci/ tests/ docker/ returns the flag parse plus one true consumer, upgrade_runner.sh:131. Both of CI's configure flag branches were run (the --encrypted-storage coin flip and USE_DATABASE_ORDINARY=1 included), and post-fix a 26.8 server parses the complete drop-in set with zero unknown-element errors, reaching the logged config load (95 drop-ins merged) that the pre-fix arm never gets to. checkUnknownSettings accumulates every unknown key before throwing, so the pre-fix exception is exhaustive, and it named only these two keys: there is no sibling offender to widen to.
g Fix generalizes across inputs (params/datatypes/wrappers)? The inputs here are versions and flags, and both matrices were run. Seven version strings through the gate expression, including the debug-build form with its trailing dot (26.9.1.1.) and 26.10.1.5, which a plain string comparison would wrongly call older than 26.9. No data types or type wrappers are involved.
h Backward compatible? (maintainer-approved exception only) Nothing to break. Test-config installation only: no user-visible behaviour, no setting default, no serialization format, so no SettingsChangesHistory.cpp row and no experimental gate. The gate errs only conservatively: were silk ever backported to a 26.8.x patch it would skip a drop-in that server could parse, which costs nothing. No backport is needed here, since config.d/silk.xml does not exist on any active release branch.
i Invariants and contracts preserved? The invariant is that every drop-in install.sh installs must be parseable by the server that will read it, and the change restores it. check_clickhouse_version is called in if context, where set -e does not apply to the condition, so its return 1 skips the branch instead of aborting the script; the old-binary runs exited 0 with the gate returning 1, which demonstrates that. The drop-in is still created between transactions.xml and encryption.xml, and config.d merge order is alphabetical at read time regardless. No error path or early return is altered.

Session id: cron:clickhouse-impl-slot-4:20260830-144900

@clickhouse-gh

clickhouse-gh Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [bc8f351]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_llvm_coverage, AsyncInsert, s3 storage, parallel) ERROR

AI Review

Summary

This PR gates tests/config/config.d/silk.xml behind check_clickhouse_version 26.9 so the Upgrade check no longer feeds 26.8 a config it cannot parse. I traced the current install.sh callers (stress_tests.lib, functional_tests.py, fast_test.py) and the version probe is evaluated against the same clickhouse binary that will read the generated config, so the fix matches the intended contract. I did not find a correctness, compatibility, or coverage regression in the current code; the remaining gap is that install.sh still has no focused automated test, so this class is covered mainly by the upgrade-check job itself.

Final Verdict

✅ No findings.

LLVM Coverage Report

⚠️ No coverage measurement for commit bc8f351: no coverable C/C++ source files changed (contrib/ is excluded from coverage).

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 30, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @alexey-milovidov, could you review this? It is the same gate you added in 16064cd for http_paths: install.sh symlinked config.d/silk.xml unconditionally, so when v26.8.1.2041-lts became the previous release the old server started rejecting enable_silk_runtime as an unknown config element, and Upgrade check (amd_release) has failed on every PR run since 13:48Z today.

@alexey-milovidov alexey-milovidov 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.

This is shit.

@groeneai, Thanks for fixing!

@alexey-milovidov alexey-milovidov self-assigned this Aug 30, 2026
@alexey-milovidov
alexey-milovidov merged commit bb113c3 into ClickHouse:master Aug 30, 2026
506 of 512 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 30, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 31, 2026
… config) so the upgrade check can start the previous release
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 31, 2026
… config so the upgrade check can start the previous release)
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 31, 2026
… config so the upgrade check can start the previous release)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue / pr blocks a new release can be tested Allows running workflows for external contributors groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect 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