Repository navigation
Port masking-policy gate and Keeper component propagation in MergeTreeDataSelectExecutor - #126866
Conversation
…eeDataSelectExecutor` In `partHasStaleTopKIndex`, also consider enabled masking policies (only in builds with `CLICKHOUSE_CLOUD`), and pass them to `getAlterConversionsForPart`, which takes this extra argument in such builds. Without it the code did not compile with `CLICKHOUSE_CLOUD`. In `filterPartsByPrimaryKeyAndSkipIndexes`, propagate the Keeper component into the skip-index analysis thread pool jobs, since `ThreadGroupSwitcher` does not carry it. This reduces divergence with downstream forks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [174d493] Summary: ✅
AI ReviewSummaryPR #126866 propagates the Keeper component into index-analysis workers and prevents pruning masked data using physical index bounds. Reviewed head Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units8 translation units recompiled, 47 s compile time in total, 8 of them have a recent master baseline. |
…under masking policies A masking policy rewrites columns at read time but is not part of the mutation snapshot, so `ReadFromMergeTree::supportsSkipIndexesOnDataRead` accepted such a read and `MergeTreeSkipIndexReader` loaded unmasked minmax / primary index bounds for top-K pruning, which could compare them with a threshold produced from masked rows. Treat enabled masking policies like pending mutations: disable skip indexes on data read and the read-time primary-key pruning (top-K and join runtime filters). Outside of builds with `CLICKHOUSE_CLOUD`, `hasEnabledMaskingPolicies` is always `false`, so there is no behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cies `RuntimeFilterReadRangesRefiner` prunes ranges by the on-disk primary index, which describes unmasked values when a masking policy rewrites the key columns at read time. Leave such a read ungated, so the refiner is not installed on the read pools. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Small changes in
MergeTreeDataSelectExecutorandReadFromMergeTree, to reduce divergence with downstream forks:partHasStaleTopKIndexnow includes enabled masking policies in the gate that decides whether to build alter conversions and check the top-k skip index for staleness, and passes them toMergeTreeData::getAlterConversionsForPart, which takes this extra argument in builds withCLICKHOUSE_CLOUD. Previously this call missed the argument, so the code did not compile in such builds. Outside of themhas_masking_policiesis alwaysfalse, so there is no behavior change.filterPartsByPrimaryKeyAndSkipIndexesnow propagate the Keeper component (Coordination::getCurrentComponent/setCurrentComponent), sinceThreadGroupSwitcherdoes not carry it and skip-index analysis may read from a Keeper-backed disk.ReadFromMergeTreetreats enabled masking policies like pending mutations: it disables skip indexes on data read (supportsSkipIndexesOnDataRead) and the read-time primary-key pruning, since the on-disk index bounds describe unmasked values. Outside ofCLICKHOUSE_CLOUDbuildshasEnabledMaskingPoliciesis alwaysfalse, so there is no behavior change.seal_gate_refiner) when masking policies are enabled, becauseRuntimeFilterReadRangesRefinerprunes by the on-disk primary index.Changelog category (leave one):
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/126866]
Version info
26.11.1.714-master(included in26.11and later)