Repository navigation
Refuse to install test configs when destination aliases the source - #111250
alexey-milovidov merged 6 commits into
Conversation
|
Workflow [PR], commit [9d46cfd] Summary: ✅ AI ReviewSummaryThis PR hardens Findings❌ Blockers
Final VerdictStatus: ❌ Block Minimum required action: protect the LLVM Coverage ReportMeasured on commit 9d46cfd.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +201 lines in 66 files (-94 lines lost coverage) · Details |
`readlink -f` only resolves symlinks, so a bind mount of `tests/config` (or its `config.d`) onto the destination slipped past the guard and `rm -rf` still wiped the tracked source configs. `-ef` compares device and inode, catching both symlinks and bind mounts. Also refuse when the destination server directory itself is the source directory. Addresses review: ClickHouse#111250 (comment) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=111250&sha=6c5784dbcfd305d289faa5f06cd24f51a1ee770d&name_0=PR&name_1=Stress%20test%20%28amd_msan%29 ( |
|
Acknowledged. This is a bug on master, unrelated to this PR. CREATE TABLE t (k UInt64) ENGINE = Memory;
CREATE TABLE keys (k UInt64) ENGINE = Memory;
CREATE ROW POLICY p ON t USING k IN (SELECT k FROM keys LEFT ARRAY JOIN 'abc', {x:Identifier}) TO ALL;
SELECT * FROM t; -- Logical error: '!part.empty()'The same path is also reachable in a single query through |
|
The fix is in #122688. |
…e root Check all four pairings of the destination root / `config.d` against the source root / `config.d` with `-ef`, so that a setup where only `DEST_SERVER_PATH/config.d` is the same directory as `tests/config` no longer lets `rm -rf` wipe the tracked configs. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ses the source The guard only covered `DEST_SERVER_PATH` and its `config.d`, but the script also writes into `DEST_SERVER_PATH/users.d` and `DEST_CLIENT_PATH`. Check every mutated destination directory against the source root and each of its subdirectories. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… the source With `--db-replicated`, `tests/config/install.sh` copies the installed server configs into `$DEST_SERVER_PATH/../clickhouse-server1` and `.../clickhouse-server2` and then removes and rewrites files there. The source-alias guard added in ClickHouse#111250 did not check these sibling directories, so a symlink or bind mount from one of them back to `tests/config` still rewrote the tracked configs. Factor the guard into `refuse_if_dest_aliases_source` and also call it for the replica directories, right after they are created, so `..` resolves the same way as for the subsequent `cp`/`rm`/redirects. Related: ClickHouse#111250 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Closes: #90883
Problem
tests/config/install.shdeletesDEST_SERVER_PATH/config.dwithrm -rf, then repopulates it with symlinks derived fromSRC_PATH/config.d.If
DEST_SERVER_PATHis set up so itsconfig.dresolves to the same directory as the repo's owntests/config/config.d(for example a bind mount pointing/etc/clickhouse-serverback at the source tree), thatrm -rfdeletes the tracked source configs instead of just clearing generated symlinks.This also explains the
<async>0</async>/<async>1</async>flip reported in the issue: after theconfig.dwipe, the foursed-generated files (logger_trace.xml,keeper_port.xml,storage_conf.xml,storage_conf_02944.xml) get rewritten in place with randomized values, leavinggit statusdirty on the tracked source tree.Fix
Resolve both paths with
readlink -fand compare them before the destructive step.If they alias, the script exits with an error instead of running.
Changelog category (leave one):
Changelog entry:
Workflow [PR]
Sync PR [sync-upstream/pr/111250]
Version info
26.10.1.1132-master(included in26.10and later)