Antalya 25.8: Backport upstream fixes for parallel replicas + RIGHT/JOIN chains LOGICAL_ERROR#1724
Open
CarlosFelipeOR wants to merge 4 commits intoantalya-25.8from
Open
Conversation
The cherry-pick of ClickHouse#97316 onto antalya-25.8 had a manual conflict resolution that lost two parts of the upstream version of should_disable_parallel_replicas(): * the n-way CROSS JOIN branch (sets is_cross_join = true and consumes it next to is_full_join / is_global_join) * the explicit fallback for RIGHT JOIN with a distributed/remote right-side table (consumes is_right_join_with_remote_table) Without these reads the two variables were "set but not used", which fast-test catches as -Werror,-Wunused-but-set-variable / -Wunused-variable. Restore them verbatim from upstream/master. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fix was authored with assistance from AI model Claude Opus 4.7.
Cherry-picks three upstream PRs to fix the
LOGICAL_ERRORExpected JOIN table expression to be table, table function, query or union nodethat crashes the server when
parallel_replicasis enabled and a query has a chain of JOINs (LEFT/INNER...RIGHT, RIGHT...RIGHT, n-way with GLOBAL/FULL).The crash is reproducible in
Stress test (amd_tsan)onantalya-25.8(e.g. run 25215170829 on sha66579939, log_comment03208_multiple_joins_with_storage_join.sql). Same crash also happens inupstream/25.8(~7.8% fail rate over 30 days) - the fix landed onmasterin Feb/2026 but was never backported to any stable branch (25.3, 25.6, 25.7, 25.8).Cherry-picked commits, in order:
ClickHouse#97316 had a small textual conflict in
src/Planner/PlannerJoinTree.cpp(different variable names from the intermediate state landed by ClickHouse#87178) andtests/parallel_replicas_blacklist.txt(Altinya-25.8 carries extra blacklist entries upstream master no longer has). Both resolved manually keeping the logic from ClickHouse#97316 verbatim.Related upstream issues: ClickHouse#74341, ClickHouse#81144, ClickHouse#84771, ClickHouse#63984.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Backport upstream fixes for
LOGICAL_ERRORin queries with parallel replicas and multiple JOINs (LEFT/INNER...RIGHT, RIGHT...RIGHT, n-way with GLOBAL/FULL). Such queries now correctly fall back to non-parallel execution instead of crashing.Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run:
Made with Cursor