Skip to content

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 into
backport/26.4/104296from
cherrypick/26.4/104296
May 20, 2026
Merged

robot-ch-test-poll2 merged 15 commits into
backport/26.4/104296from
cherrypick/26.4/104296

Conversation

@robot-ch-test-poll2

Copy link
Copy Markdown
Contributor

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-pick locally.
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:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

azat and others added 15 commits May 18, 2026 21:47
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.
Disable additional_table_filters with parallel replicas and analyzer and w/o query plan serialization
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels May 20, 2026
@robot-ch-test-poll2
robot-ch-test-poll2 merged commit 4cb1c02 into backport/26.4/104296 May 20, 2026
@robot-ch-test-poll2
robot-ch-test-poll2 deleted the cherrypick/26.4/104296 branch May 20, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants