Skip to content

Sync a batch of private changes to public files - #124599

Merged
Algunenano merged 9 commits into
ClickHouse:masterfrom
Algunenano:sync-private-to-public-1
Oct 8, 2026
Merged

Algunenano merged 9 commits into
ClickHouse:masterfrom
Algunenano:sync-private-to-public-1

Conversation

@Algunenano

@Algunenano Algunenano commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Move a batch of changes made to public files in private to public, to reduce the drift between both repositories. Each commit is a separate change:

  • Carry QueryCancellationBlocker into the distributed cache background write thread
  • Sync stateless test tags for tests that do not apply to cloud-only configurations
  • Shorten 01076_parallel_alter_replicated_zookeeper and check that a mutation applied
  • Allow virtual columns of borrowed parts in IMergeTreeReader::fillVirtualColumns
  • Check CREATE MASKING POLICY when restoring masking policies from a backup
  • Check only registry-wide readiness when creating distributed cache temporary files
  • Route UNDROP TABLE on a Shared database through the shared catalog
  • Throw INCORRECT_DATA on mismatched internal columns of Dynamic
  • Ignore files next to client directories when loading the filesystem cache

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Version info

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

@clickhouse-gh

clickhouse-gh Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [49ca36c]

Summary: ✅


AI Review

Summary

This PR syncs a batch of private changes into public sources: query-cancellation blocker propagation into thread-pool jobs, shared-catalog UNDROP, distributed-cache temporary-file readiness, borrowed-part virtual columns, and several stateless-test/tag updates. Most hunks look consistent, but the borrowed-part virtual-column change is still incomplete: stateless-worker reads now bypass the type check, yet const reader virtuals still fall back to NOT_IMPLEMENTED.

Findings

⚠️ Majors

  • [src/Storages/MergeTree/IMergeTreeReader.cpp:246] fillVirtualColumns still requires a concrete IMergeTreeDataPart for the const reader virtual columns (_part, _part_uuid, _partition_id, _partition_value, _part_data_version, _disk_name). Borrowed parts only bypass the initial type check; they still hit this NOT_IMPLEMENTED branch, so queries that project those virtual columns on the stateless-worker path remain broken.
    Suggested fix: synthesize those fields from IMergeTreeDataPartInfoForReader (getPartName, getPartInfo, getPartition, getDataPartStorage, getMaxDataVersion, etc.) instead of calling getFieldForConstVirtualColumn only for LoadedMergeTreeDataPartInfoForReader.
Final Verdict

⚠️ Changes requested — the borrowed-part virtual-column fix does not yet satisfy the advertised contract for const reader virtual columns.

LLVM Coverage Report

Measured on commit 49ca36c.

Metric Baseline Current Δ
Lines 88.30% 88.30% +0.00%
Functions 92.10% 92.20% +0.10%
Branches 79.70% 79.70% +0.00%

Changed lines: Changed C/C++ lines covered: 44/55 (80.00%) · Uncovered code

Full report · Diff report

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Oct 8, 2026
@antonio2368 antonio2368 self-assigned this Oct 8, 2026
Algunenano and others added 9 commits October 8, 2026 11:25
…d write thread

Sync from private: the background thread now creates its own blocker when the caller had one, so a cancelled merge cannot throw from `MergeTreeTransaction::afterCommit`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tags such as `no-shared-merge-tree`, `no-shared-catalog` and `no-distributed-cache` were added in private only, for tests that do not apply to cloud-only configurations.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mutation applied

Sync from private: lower the stress timeout so the drain after it fits the test timeout on slow storage, and assert that at least one `ALTER UPDATE` reached the visible data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tualColumns`

Sync from private: constant virtual columns are taken from the data part only when it is a loaded part, so the cloud-only borrowed part info no longer returns early.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…backup

Sync from private: the cloud-only masking policy entity was missing in `AccessRestorerFromBackup::getRequiredAccess`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…mporary files

Sync from private: server availability is checked by the temporary file holder itself, and the error is `CANNOT_USE_DISTRIBUTED_CACHE` instead of `LOGICAL_ERROR`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sync from private: also set the Keeper component for the query.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sync from private: the mismatch comes from data read from disk, so it is not a logical error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ache

Sync from private: a server of another version may keep its own files there, and opening one as a directory failed the whole load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano
Algunenano force-pushed the sync-private-to-public-1 branch from b1dd92f to 49ca36c Compare October 8, 2026 11:26
@clickhouse-gh clickhouse-gh Bot added the comp-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. label Oct 8, 2026
@Algunenano
Algunenano added this pull request to the merge queue Oct 8, 2026
Merged via the queue into ClickHouse:master with commit d38447b Oct 8, 2026
152 checks passed
@Algunenano
Algunenano deleted the sync-private-to-public-1 branch October 8, 2026 23:33
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 8, 2026
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Nov 12, 2026
… mask

`StringBytesUniqImpl::process` kept a 32-byte `UInt64 mask[4]` on the stack and,
for every row, zeroed it with one 32-byte store, did a load-or-store per byte and
reloaded all 32 bytes for the popcount. On aarch64 the speed of that per-row
store/reload depends on the alignment of `mask`, which is decided by the stack
depth at the call, i.e. by unrelated caller frames: `executeImpl` is identical in
8 arm builds, 4 fast and 4 slow, and the slow ones are exactly those where `mask`
lands 32-byte aligned (depth at entry mod 32 = 16). ClickHouse#124599 (thread pool worker
frame 592 -> 608 bytes) flipped master to fast, ClickHouse#112705
(`ExpressionTransform::transform` 400 -> 480 bytes) flipped it back to slow, so
`string_bytes_functions #0` runs at 0.050 or 0.061 s per arm binary and is
reported `slower` on PRs whose binary draws the other mode than its reference
(21 PRs plus master in 30 days on arm_release, none on amd_release).

Count with a per-call table of the last row number in which each byte value
occurred instead. It is zeroed once per `executeImpl` call and never cleared
between rows, so the only per-row stack traffic left is the 8-byte, 8-aligned
load and store of the table entry per byte. `alignas` on `mask` was rejected:
the 32-byte-aligned placement is the slow one, so it would pin every build to
the slow mode. A register-resident mask was measured 1.2-1.85x slower on x86.

`FunctionStringBytes::executeImpl` now calls `process` on a local `Impl`, and
`StringBytesEntropyImpl::process` becomes a `const` member; entropy's machine
code is unchanged.

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-query-execution Runtime execution pipeline, processors, vectorized operators, resource management during execution. pr-not-for-changelog This PR should not be mentioned in the changelog 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