Skip to content

Re-decide the build-type-dependent test configs when bugfix validation swaps the binary - #118459

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:bugfix-validation-redecide-build-type-configs
Sep 9, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:bugfix-validation-redecide-build-type-configs

Conversation

@groeneai

@groeneai groeneai commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #113107

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 re-decides the build-type-dependent server configs each time it swaps in another build type's binary, so the MemorySanitizer build no longer refuses to start on a config installed for the sanitizer build.

Description

Since #113107 an msan server rejects a non-zero global_profiler_real_time_period_ns, and both
Bugfix validation (functional tests, amd64|aarch64) legs are red on every PR whose build-type
list reaches *_msan: Server startup (amd_msan) ERROR and Scraping system tables FAIL with
Code: 48 ... not supported in a MemorySanitizer build. 16 CIDB rows across two unrelated PRs,
both arches, none on master and none before #113107 merged.

install.sh links serverwide_trace_collector.xml unless the installed binary is msan, and it
runs once, in the START stage, against build_types[0] (always *_asan_ubsan). The validation
loop then swaps the binary for each remaining build type without re-deciding that config, so the
msan server throws while parsing its own settings and never starts. build_types[1:] is also how a test that did
not reproduce on the first build type is retried, so such a bug-fix PR can no longer be
validated on either arch.

trace_log_no_symbolize.xml is the mirror case on the *_debug swap: linked for the sanitizer
binary, it stays behind and leaves in-flush symbolization off, unreachable so far only because the
loop breaks at *_msan first.

So the configs are re-decided after each swap, beside the existing
set_memory_ratio/reset_memory_ratio re-derivation, which is there for the same reason. The probes
now fail closed instead of mislinking: in an if condition bash suppresses set -e, so an
unanswerable probe read as false, which is the arm that installs the msan-fatal config.

The /etc/clickhouse-server{1,2} copies of a DBReplicated run are re-decided too, since a
server runs from each; no configured job combines the two today (the bugfix legs are per-arch, and
--bugfix-validation --db-replicated aborts inside install.sh regardless).

Validated with the real master-HEAD amd_asan_ubsan/amd_msan/amd_debug binaries: the abort
reproduces before the change, every tree starts after it, and a normal install produces an
identical config tree. Touching ci/jobs/functional_tests.py runs both bugfix legs on
this PR itself.


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

Version info

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

`install.sh` picks two configs by probing the installed binary:
`serverwide_trace_collector.xml` unless it is a MemorySanitizer build, and
`trace_log_no_symbolize.xml` when it is a sanitizer build. That decision is a
property of whichever binary is installed when the script runs, so a caller
that later replaces the binary under the same tree keeps a decision made for
the previous one.

Move both probes into `install_build_type_configs`, which is idempotent in both
directions (it links the file its guard wants and removes the one it does not),
and expose it through `--build-type-configs-only` so an installed tree can be
re-decided without reinstalling anything. The early return sits before the
`rm -rf config.d`, so the mode adjusts a populated tree instead of rebuilding
it. A normal install produces a byte-identical `config.d`/`users.d` listing:
the two `ln -sf` calls run at the same point as before, and the new `rm -f`
arms cannot fire there because `config.d` was just wiped.

The probes now fail closed. Each was `[ "$(clickhouse local ...)" = "1" ]`
evaluated in an `if`/`!` condition, where bash suppresses `set -e`, so a probe
that could not run read as false. The false arm of the MemorySanitizer guard is
the one that installs the config an msan server refuses to start on, which
means an unanswerable probe reported success and left a tree that kills the
server later. `countIf` additionally makes each query total: the previous form
returned no rows at all when the `CXX_FLAGS` row was absent, which is the same
output as a false answer. A binary that can answer answers exactly as before.
The validation loop swaps in the master-HEAD binary for each remaining build
type without reinstalling the config tree, which was installed for
`build_types[0]`, always `*_asan_ubsan`. Since ClickHouse#113107 an msan server rejects a
non-zero `global_profiler_real_time_period_ns` while parsing its own settings,
so the tree's leftover `serverwide_trace_collector.xml` aborts startup with
`Code: 48 NOT_IMPLEMENTED` on the `*_msan` swap. That turns both
`Bugfix validation (functional tests, amd64|aarch64)` legs red, and because the
loop breaks there, `*_msan` and `*_debug` can no longer supply a reproduction
for a labelled bug-fix PR whose test does not reproduce on `*_asan_ubsan`.

The `*_debug` swap has the mirror problem: `trace_log_no_symbolize.xml`, linked
for the sanitizer binary, stays behind and silently leaves in-flush
symbolization off, unlike the ordinary `Stateless tests (debug)` job. It was
unreachable so far only because the loop breaks at `*_msan` first.

Call `install_build_type_configs` after the swap, beside the existing
`set_memory_ratio`/`reset_memory_ratio` re-derivation, which is there for the
same reason: the config tree outlives the binary it was installed for.
@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 Sep 6, 2026
@groeneai

groeneai commented Sep 6, 2026

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 an independent
cold read of the diff by the reviewing session (3 nits, all editorial, resolved in the PR body
before publication).

# Sev Finding Verdict Evidence / action
1 ⚠️ The *_debug half of the new helper is unverified, because this PR's own bugfix legs run only 00001_select_1, which cannot observe a stale trace_log_no_symbolize.xml DISAGREE The debug transition is asserted against the real master-HEAD amd_debug binary, on the tree the msan step leaves behind: no_symbolize stale-present before (present), then after the re-decide trace_log_no_symbolize.xml (absent), serverwide_trace_collector.xml (present), server up, global_profiler_real_time_period_ns = 1000000000. The pre-state assertion is the disabled-cleanup arm measured on the same tree, so the oracle fails if that arm is a no-op. The behavioural test the finding proposes, 03150_trace_log_add_build_id, is tagged no-asan, no-tsan, no-msan, no-ubsan exactly because the harness links this config on sanitizer builds, so running it would mean changing the hard-coded self-test selection at functional_tests.py:841-843 for every CI-fix PR: a separate change on a shared path.

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

Residual I am disclosing rather than fixing: CI validates the *_msan carrier end-to-end on this
PR, on both arches, while the *_debug carrier is covered by the local A/B above plus the set -x
trace of the decision in the job log. A CI-side oracle for it would mean changing what bugfix
validation runs, which I did not do here.

Session id: cron:clickhouse-review-slot-10:20260906-192400

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 6, 2026
@clickhouse-gh clickhouse-gh Bot closed this Sep 6, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d97e8a3]

Summary: ✅


AI Review

Summary

This PR fixes the bugfix-validation binary-swap path by re-running the build-flavor-dependent config selection after each swap and by applying the same re-decision to the installed replica config trees. I did not find a remaining correctness or reliability issue in the current diff.

Missing context / blind spots
  • ⚠️ The end-to-end Bugfix validation (functional tests, amd64|aarch64) jobs were still pending while I reviewed this, so the *_msan and *_debug swap paths are validated here by code inspection rather than by completed CI evidence. A green run of those jobs would close this gap.
Final Verdict

✅ No new review findings in the current code. The previously reported replica-tree issue is fixed.

LLVM Coverage Report

Measured on commit d97e8a3.

Metric Baseline Current Δ
Lines 88.80% 88.80% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 81.10% 81.20% +0.10%

Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage).

Newly covered: +944 lines in 216 files (-863 lines lost coverage) · Details

Full report

@groeneai

groeneai commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

cc @alexey-milovidov, could you review this? #113107 made an msan server reject a non-zero global_profiler_real_time_period_ns and added the paired install.sh guard, but bugfix validation installs the config tree once for build_types[0] and then swaps in each remaining build type's binary, so the msan server reads a config only a non-msan server accepts and never starts. This re-decides the two build-type-dependent configs at each swap.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Sep 6, 2026
Comment thread ci/jobs/scripts/clickhouse_proc.py Resolved
…d tree

`install_build_type_configs` adjusted only the main config tree, while a
`DBReplicated` run also starts a server from `/etc/clickhouse-server1` and
`/etc/clickhouse-server2`. Those trees are copies of the main one, so they keep
the configs decided for the previous build type: after an `*_msan` swap the
replicas still carry `serverwide_trace_collector.xml` and refuse to start with
`Code: 48 ... global_profiler_real_time_period_ns is not supported in a
MemorySanitizer build`, which is the failure this branch fixes for the main
tree. `set_memory_ratio` fans out over the same trees for the same reason.

No configured job reaches that combination today, in two independent ways: the
two `Bugfix validation (functional tests, *)` jobs pass `--options
BugfixValidation` with an arch-only ParamSet, so `is_db_replicated` is always
false; and `install.sh --bugfix-validation --db-replicated` cannot finish at
all, because the DBReplicated block removes `config.d/keeper_port.xml` and the
bugfix block then runs `sed -i` on it. Fanning out keeps the helper's contract
equal to the set of trees a server is started from, so whoever makes that
combination runnable does not have to rediscover this.

Verified with the real master-HEAD amd_asan_ubsan / amd_msan / amd_debug CI
binaries on a real `install.sh --db-replicated` tree: with the previous helper
replica 1 fails startup with the verbatim `Code: 48` while the main tree starts,
with this one all three trees are re-decided and all three start. A run without
the replica trees still invokes `install.sh` exactly once.

Co-Authored-By: Claude Opus 5 <[email protected]>
@alexey-milovidov alexey-milovidov self-assigned this Sep 9, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 9, 2026
Merged via the queue into ClickHouse:master with commit 3b3489b Sep 9, 2026
174 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 Sep 9, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 10, 2026
The published head predates ClickHouse#118459 (merged
2026-09-09T22:21:53Z), which re-decides the build-type-dependent test
configs when bugfix validation swaps in a sanitizer binary. Without it
the two `Bugfix validation (functional tests, *)` arms cannot start the
msan server: it refuses `global_profiler_real_time_period_ns` while
parsing its own config, so the job reports `Server startup` ERROR and
`Finish Workflow` reds on the cascade.
fm4v added a commit that referenced this pull request Sep 10, 2026
Use the existing build-type configuration refresh from master, replacing
the redundant local profiler helper. Preserve coverage symbolization
settings, test isolation, and the new repeated-test scheduler.

Resolve test conflicts by retaining master's query-specific text-log
assertions and test exclusions together with this PR's identities and
serialization reasons.

Related: #118459
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110015&sha=83ce1a54e7d849d0c3a4356ae36444199532441f&name_0=PR
#110015
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). groeneai-origin-ci-own-pr PR origin: CI on a groeneai PR exposed a separate defect 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