Repository navigation
Plan-based parallel replicas: keep reads of UNIQUE KEY tables local - #133744
Conversation
#128534 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [0127144] Summary: ✅
AI ReviewSummaryReviewed PR 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 units7 translation units recompiled, 14 s compile time in total, 7 of them have a recent master baseline. |
groeneai
left a comment
There was a problem hiding this comment.
Checked at c5fb534.
ReadFromMergeTree::serializethrowsSUPPORT_IS_DISABLEDfor any read whose metadata has a unique key, andmergeTreeReadCanBeShippedis the one predicate behind every shipped read: the coordinated read (mergeTreeReadCanBeCoordinated), the broadcast side of a join and the plan of anINset (subtreeHasUnshippableRead), andMergeexpansion (getExpandableReads,mayBeExpandedForParallelReplicasintopKThroughJoin.cpp). One check there covers all of them, next to the temporary-table, projection and Top-K rejections.- CI on this head: the 8 tests dropped from the blacklist, plus 04161 and 05493, are OK in both plan-based jobs (
arm_binary, ParallelReplicas, plan-based, s3 storage, parallelandsequential).05871_pr_plan_based_unique_key_readis OK in the plan-based job and in all five flaky checks (50 runs each).
One leftover: tests/queries/0_stateless/05836_unique_key_preserves_insert_order.sh (lines 51-54) has the same pin, SET parallel_replicas_plan_based = 0; under a comment linking #128534. It was added by 7eb6ee7 on 2026-11-20, after #132872, so this PR does not remove it. With this change it can go like the two others.
…y-serialization Conflict resolution: - `master` reverted the sparse serialization of `JSON` typed paths (#133486 reverting #111429), which removed `SerializationInfoNamed` and `SerializationInfoObject`. The `checkKindStacks` and `checkKindStackForType` overrides move back to `SerializationInfoTuple`, the ones of `SerializationInfoObject` are dropped together with the class, and `MutateTask` uses `canUseSparseSerialization` again instead of the removed `shouldCollectSerializationInfo`. - `NativeWriter::getSerializationAndColumn`: keep the materialization of non-native `LowCardinality` columns for old peers on top of the reverted code. - `tryGetSerializationHints` now takes the metadata snapshot (#133300): pass it through in the overrides this branch adds for the wrapper storages. - `tests/parallel_replicas_plan_based_blacklist.txt`: `master` removed the whole `UNIQUE KEY` section, because plan-based parallel replicas now keep such reads local (#133744), so `05449_auto_low_cardinality_serialization_unique_key` is not listed anymore. Co-Authored-By: Claude Fable 5.2 <[email protected]>
With plan-based parallel replicas (
parallel_replicas_plan_based), a read of aUNIQUE KEYtable is shipped to the replicas, andReadFromMergeTree::serializerefuses it withdistributed query plan is not supported on UNIQUE KEY tables(SUPPORT_IS_DISABLED), so the query fails. Query-based parallel replicas doesn't distribute such a read (isStorageEligibleForParallelReplicas).mergeTreeReadCanBeShippednow refuses a read of aUNIQUE KEYtable. It's used for every shipped read: the coordinated read, the broadcast side of a join,INsets andMergeexpansion. So the read stays on the initiator, and the rest of the query can still be distributed. #132872 was meant to do this, but was merged with only two tests pinned to query-based parallel replicas; this change restores the check and removes those pins and theUNIQUE KEYentries of the plan-based blacklist.05871_pr_plan_based_unique_key_readcovers a read of aUNIQUE KEYtable alone, on either side of a join, and in anINset, without the local plan. Every query fails without the change.Closes: #128534
Related: #132872
Related: #133745
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133744]
Version info
26.12.1.399-master(included in26.12and later)