Skip to content

PR: adding parallel_replicas_filter_pushdown setting - #95510

Merged
alexey-milovidov merged 8 commits into
masterfrom
pr-filter-pushdown-setting
Jan 30, 2026
Merged

alexey-milovidov merged 8 commits into
masterfrom
pr-filter-pushdown-setting

Conversation

@devcrafter

@devcrafter devcrafter commented Jan 29, 2026 •

Copy link
Copy Markdown
Member

parallel_replicas_filter_pushdown setting to enable/disable parallel replicas filter pushdown functionality implemented in #88316. Disabled by default.

It mitigates #95524

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.2.1.130
  • Backported to: 26.1.2.9, 25.12.5.40

@clickhouse-gh

clickhouse-gh Bot commented Jan 29, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d8d3765]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_ubsan, sequential) failure
02962_system_sync_replica_lightweight_from_modifier FAIL cidb, issue
UndefinedBehaviorSanitizer: undefined behavior (STID: 2085-4579) FAIL cidb
Stateless tests (amd_debug, distributed plan, s3 storage, parallel) failure
02969_functions_to_subcolumns_if_null FAIL cidb
Segmentation fault (STID: 1805-4445) FAIL cidb
Stress test (amd_debug) failure
Logical error: Block structure mismatch in A stream: different number of columns: (STID: 0993-38e6) FAIL cidb, issue
Stress test (amd_tsan) failure
Logical error: There was an error on A: B (probably it's a bug) (STID: 6337-3cad) FAIL cidb, issue
Stress test (amd_ubsan) failure
Logical error: Block structure mismatch in A stream: different number of columns: (STID: 0993-38e6) FAIL cidb, issue

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jan 29, 2026
Comment thread src/Core/SettingsChangesHistory.cpp Resolved
@alexey-milovidov

Copy link
Copy Markdown
Member

Ok. Mark the setting as Beta.

In the subsequent PR (if not end up fixing), disable the setting in the Stress test, AST Fuzzer, and BuzzHouse configs to prevent red CI.

@alexey-milovidov alexey-milovidov self-assigned this Jan 30, 2026
@alexey-milovidov
alexey-milovidov merged commit d0525e3 into master Jan 30, 2026
125 of 130 checks passed
@alexey-milovidov
alexey-milovidov deleted the pr-filter-pushdown-setting branch January 30, 2026 11:30
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 30, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jan 30, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jan 30, 2026
Backport #95510 to 26.1: PR: adding parallel_replicas_filter_pushdown setting
@robot-ch-test-poll robot-ch-test-poll added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jan 30, 2026
clickhouse-gh Bot added a commit that referenced this pull request Jan 30, 2026
Backport #95510 to 25.12: PR: adding parallel_replicas_filter_pushdown setting
nickitat added a commit that referenced this pull request Aug 31, 2026
`parallel_replicas_filter_pushdown` gates two different things. On the remote half of the
read it splices the predicate into the query AST shipped to the replicas
(`ReadFromParallelRemoteReplicasStep::initializePipeline` -> `addFilters`). On the local half it
only moves a `Filter` into the plan fragment the initiator runs itself, which is an ordinary
in-process plan optimization - the fragment is then optimized like any other plan, so the
predicate becomes a `PREWHERE` and prunes the index.

Stop gating the local half. `ReadFromLocalParallelReplicaStep` exists only when
`canUseLocalPlanForParallelReplicas` accepted the query, so this is exactly "ignore the setting
in local mode"; the setting keeps governing the remote query, where the AST surgery lives.

Nothing is filtered on the initiator only: the union push-down clones the `Filter` into both
branches and pushing into a `SourceStepWithFilterBase` keeps the step, so the remote branch
still filters what the replicas send back. The replicas also need not agree on which ranges the
local plan reads - each announces its own and the coordinator reconciles them.

The push-down used to be unconditional; the setting was added in #95510 to mitigate
#95524, where a filter reaching the local plan
let `optimize_aggregation_in_order` pick a coordination mode the replicas did not use
("Replica 1 decided to read in WithOrder mode, not in ReverseOrder"). That was fixed at its root
in #98467, and the local plan now inherits the read-in-order gates from the subquery's own
settings, so the mitigation is no longer needed. `03787_pr_group_by_read_mode_error`,
`03810_pr_aggr_in_order_read_mode` and `04009_pr_aggr_in_order_coordination_mode` cover it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WCAGFHu72JG9die3EDo8t4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo v25.12-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants