Skip to content

Refuse install.sh --db-replicated when a replica config dir aliases the source - #123180

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-install-sh-replica-dir-alias-guard
Oct 1, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-install-sh-replica-dir-alias-guard

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #111250, addressing the remaining review thread there: #111250 (comment) (bot finding on --db-replicated).

With --db-replicated, tests/config/install.sh copies the installed server configs into $DEST_SERVER_PATH/../clickhouse-server1 and .../clickhouse-server2, then removes and rewrites files there. The source-alias guard from #111250 did not cover these sibling directories, so if one of them was a symlink or bind mount back to tests/config, the tracked configs were still rewritten.

This factors the guard into refuse_if_dest_aliases_source and also calls it for the replica directories (and their config.d/users.d) right after they are created, so .. resolves the same way as for the later cp/rm/redirects. Verified locally against a copied tests/config: clickhouse-server1 -> src and clickhouse-server2/config.d -> src/config.d both refuse and leave the source untouched, and a normal --db-replicated install succeeds.

Related: #111250
Related: #90883

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.10.1.1187-master (included in 26.10 and later)

… 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
#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: #111250

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1075169]

Summary: ✅


AI Review

Summary

This PR factors the destination/source alias check in tests/config/install.sh into refuse_if_dest_aliases_source and applies it to the extra clickhouse-server1 / clickhouse-server2 trees created by --db-replicated. The changed code matches that contract: the replicated-install path now rejects the same symlink or bind-mount aliasing that the primary install path already rejected, and I do not see a remaining correctness or safety issue in the patch.

Final Verdict

✅ No blockers or majors.

LLVM Coverage Report

Measured on commit 1075169.

Metric Baseline Current Δ
Lines 88.30% 88.30% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 79.70% 79.70% +0.00%

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

Newly covered: +120 lines in 41 files (-164 lines lost coverage) · Details

Full report

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 1, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 1, 2026
Merged via the queue into master with commit 70e3f8d Oct 1, 2026
149 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-install-sh-replica-dir-alias-guard branch October 1, 2026 16:38
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 1, 2026
alexey-milovidov added a commit that referenced this pull request Oct 16, 2026
- Resolve the `TODO: wait for the revert-of-revert.` on #123808: #124640
  reverted only its `WindowTransform` part and no re-apply is planned, so
  the window functions are dropped from the entry instead.
- Sort every category by significance, clustering related entries.
- Move 21 entries between categories (efficiency entries to
  `Performance Improvement`, user-visible failures to `Bug Fix`, usability
  changes out of `Bug Fix`, new SQL surface to `New Feature`).
- Merge 28 groups of entries describing the same feature or fix, including
  regressions of this release folded into the feature they broke.
- Rewrite entries that described internal classes instead of the
  user-visible effect, and fix backticks and formatting.
- Drop two pure CI/test-build entries from `Build/Testing/Packaging
  Improvement` (#123180, #125593).

Related: #120500

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants