Repository navigation
Decline automatic parallel replicas when a set cannot be paired - #126141
Conversation
When automatic parallel replicas switches a query, `moveSetsFromLocalPlanToReplicasPlan` hands the sets the single-node plan has already prepared to the parallel-replicas plan, pairing them by hash. Nothing guarantees that the two plans hash a set alike, and a set without a counterpart failed the query with the `LOGICAL_ERROR` "Cannot find a matching set in the map of sets from single-replica plan" (aborting debug and sanitizer builds). Two known causes: - The parallel-replicas plan is built from the query tree shipped to the replicas, where `ReplaceLongConstWithScalarVisitor` replaces constants longer than `optimize_const_name_size` with `__getScalar` calls, also inside an `IN` subquery, which changes the subquery's tree hash. - `convertJoinToIn` keys the set it makes by a random UUID (issue 124322). Check that every set has a counterpart before moving any, and keep the single-node plan otherwise. Closes: #124322 Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # src/Processors/QueryPlan/Optimizations/considerEnablingParallelReplicas.cpp
|
Workflow [PR], commit [dd81fe5] Summary: ✅
AI ReviewSummaryThe PR checks that every required set can be paired before transferring ownership, retaining the single-node plan when pairing fails. This avoids the PR MetadataThe Findings💡 Nits
Final VerdictStatus: ✅ Approve. Complete the changelog entry before merging. |
There was a problem hiding this comment.
LGTM ...
@nickitat Do we have such issue with plan-base parallel replicas?
no, afaict |
Backport #126141 to 26.10: Decline automatic parallel replicas when a set cannot be paired
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a
LOGICAL_ERRORwhen automatic parallel replicas cannot match prepared sets between the single-node and replica plans, including queries usingquery_plan_convert_join_to_in. These queries now retain the single-node plan.Closes: #124322
Workflow [PR]
Sync PR [sync-upstream/pr/126141]
Version info
26.11.1.212-master(included in26.11and later)26.10.2.32