Repository navigation
Cherry pick #104296 to 26.4: Disable additional_table_filters with parallel replicas and analyzer and w/o query plan serialization - #105425
Merged
robot-ch-test-poll2 merged 15 commits intoMay 20, 2026
Conversation
…allel replicas and analyzer Fixes: #104219
The problem:
Initiator: SELECT count() FROM t additional_table_filters = {'t': 'x != 0'}
Follower : SELECT count() FROM non_default_db.t additional_table_filters = {'t': 'x != 0'}
And now additional_table_filters cannot be matched on follower, let's
apply them if they do not have database, this will fix the problem.
We decided that supporting `additional_table_filters` with parallel replicas is not worth the patching: keys are resolved against the initiator's session current database, but on followers the rewritten `SELECT` uses fully qualified names and the follower's current database is the initiator's user-default DB, so the match is unreliable. Follow the existing convention for PR-incompatible features in the analyzer planner: throw `SUPPORT_IS_DISABLED` on the strict `enable_parallel_replicas = 2` level, otherwise disable parallel replicas for this query and log. Done in `Planner.cpp`, so the constraint applies only to the analyzer path. Revert the follower-side relaxation in `parseAdditionalFilterAstIfNeeded` since the combination can no longer reach it on the analyzer path. Update `04207_pr_additional_filters` to cover both behaviors.
With `serialize_query_plan = 1` the initiator lowers `additional_table_filters` into an explicit `FilterStep` (via the analyzer running in the initiator's context, where the match succeeds) and ships the serialized plan. Followers deserialize and execute the plan as-is without re-resolving the setting, so the follower-side matching ambiguity does not apply. Extend `04207_pr_additional_filters` to cover the `serialize_query_plan = 1` path and assert it returns the filtered count.
…additional filter
Disable additional_table_filters with parallel replicas and analyzer and w/o query plan serialization
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.
Original pull-request #104296
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job