Repository navigation
Re-decide the build-type-dependent test configs when bugfix validation swaps the binary - #118459
Conversation
`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.
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding), plus an independent
Severity: ❌ blocker / Residual I am disclosing rather than fixing: CI validates the Session id: cron:clickhouse-review-slot-10:20260906-192400 |
|
Workflow [PR], commit [d97e8a3] Summary: ✅ AI ReviewSummaryThis 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
Final Verdict✅ No new review findings in the current code. The previously reported replica-tree issue is fixed. LLVM Coverage ReportMeasured on commit d97e8a3.
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 |
|
cc @alexey-milovidov, could you review this? #113107 made an msan server reject a non-zero |
…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]>
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.
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
Related: #113107
Changelog category (leave one):
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 bothBugfix validation (functional tests, amd64|aarch64)legs are red on every PR whose build-typelist reaches
*_msan:Server startup (amd_msan)ERROR andScraping system tablesFAIL withCode: 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.shlinksserverwide_trace_collector.xmlunless the installed binary is msan, and itruns once, in the START stage, against
build_types[0](always*_asan_ubsan). The validationloop 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 didnot 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.xmlis the mirror case on the*_debugswap: linked for the sanitizerbinary, it stays behind and leaves in-flush symbolization off, unreachable so far only because the
loop breaks at
*_msanfirst.So the configs are re-decided after each swap, beside the existing
set_memory_ratio/reset_memory_ratiore-derivation, which is there for the same reason. The probesnow fail closed instead of mislinking: in an
ifcondition bash suppressesset -e, so anunanswerable probe read as false, which is the arm that installs the msan-fatal config.
The
/etc/clickhouse-server{1,2}copies of aDBReplicatedrun are re-decided too, since aserver runs from each; no configured job combines the two today (the bugfix legs are per-arch, and
--bugfix-validation --db-replicatedaborts insideinstall.shregardless).Validated with the real master-HEAD
amd_asan_ubsan/amd_msan/amd_debugbinaries: the abortreproduces before the change, every tree starts after it, and a normal install produces an
identical config tree. Touching
ci/jobs/functional_tests.pyruns both bugfix legs onthis PR itself.
Workflow [PR]
Sync PR [sync-upstream/pr/118459]
Version info
26.9.1.1088(included in26.9and later)