Skip to content

Do not run 02810 with parallel replicas - #131666

Merged
devcrafter merged 1 commit into
masterfrom
pr-02810-count-distinct-steps
Nov 14, 2026
Merged

devcrafter merged 1 commit into
masterfrom
pr-02810-count-distinct-steps

Conversation

@devcrafter

@devcrafter devcrafter commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

02810_fix_remove_dedundant_distinct_view counts the EXPLAIN lines that mention DISTINCT, to check that query_plan_remove_redundant_distinct removes the outer DISTINCT of a DISTINCT over a view. With parallel replicas, EXPLAIN also prints the preliminary DISTINCT that runs on the replicas: in the query sent to them with query-based parallel replicas, and in the plan fragment with plan-based parallel replicas, which ships the preliminary DISTINCT since #130355. The test is already listed in tests/parallel_replicas_blacklist.txt for that reason, and fails the same way in the plan-based parallel replicas job of #128413.

This tags it no-parallel-replicas and removes it from the blacklist. The plan is the same in all modes: the redundant DISTINCT is removed. With parallel replicas, the LIMIT of such a query is not pushed down to the replicas; that is tracked separately, with its own test to come with the fix.

Related: #131665
Related: #130355
Related: #128413

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/131666]

Version info

  • Merged into: 26.11.1.2317-master (included in 26.11 and later)

The test counts the `DISTINCT` steps in EXPLAIN. With parallel replicas, EXPLAIN also prints the preliminary
`DISTINCT` that runs on the replicas: in the query sent to them (query-based), or in the plan fragment
(plan-based, since #130355 ships the preliminary `DISTINCT`).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [022a820]

Summary: ✅


AI Review

Summary

PR #131666, head 022a8203db56ec8b54c944d24a551eba6f245f5b, replaces the parallel-replica blacklist entry for 02810_fix_remove_dedundant_distinct_view with a no-parallel-replicas tag and explains the additional preliminary DISTINCT shown by EXPLAIN. No actionable findings. Review covered the full diff, both modified files, tag parsing and enforcement, prior discussion, and the linked issue. No local server tests were run for this test-metadata-only change.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 14, 2026
@devcrafter
devcrafter requested a review from groeneai November 14, 2026 17:35
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Nov 14, 2026
@devcrafter
devcrafter enabled auto-merge November 14, 2026 18:09

@groeneai groeneai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. What I checked:

  • no-parallel-replicas covers every parallel replicas job: should_skip_test skips the test whenever the runner gets --no-parallel-replicas, and the plan-based job of #128413 gets it too (its options include ParallelReplicas), so dropping the blacklist line re-enables the test nowhere. In the other jobs the tag forces enable_parallel_replicas = 0 and skips the automatic_parallel_replicas_mode = 2 injection, so the assertion still runs there.
  • The failure was only ever the EXPLAIN count. The CI diffs (query-based job, every run in 30 days; plan-based job of #128413 since #130355 merged) are 2 -> 3 on both EXPLAIN queries, while SELECT DISTINCT x FROM tab_v ORDER BY x returns 1, 2. The tag hides no wrong result.
  • On master a33e1c16 with 3 local replicas, query_plan_remove_redundant_distinct = 1 removes the same two lines in every mode: 4 -> 2 without parallel replicas, 5 -> 3 query-based, 5 -> 3 plan-based. The extra line is the replicas' preliminary DISTINCT (the shipped fragment in plan-based, the ReadFromRemoteParallelReplicas query text in query-based), as the description says.
  • #131665 is the LIMIT pushdown gap with its own repro, separate from what 02810 asserts.

@devcrafter
devcrafter added this pull request to the merge queue Nov 14, 2026
Merged via the queue into master with commit b04bc0a Nov 14, 2026
196 checks passed
@devcrafter
devcrafter deleted the pr-02810-count-distinct-steps branch November 14, 2026 20:18
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 14, 2026
devcrafter added a commit that referenced this pull request Nov 14, 2026
…under plan-based

A plan-based replica cannot find a WASM UDF in the plan fragment:
#130859. The query added to make the test fail
deterministically ran on remote replicas in every job, and in the flaky check a replica query still
held the module when the test deleted it (`CANNOT_DROP_FUNCTION`). Restore the test and pin it instead.
Also list `02810` until #131666 is merged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
devcrafter added a commit that referenced this pull request Nov 14, 2026
…st, regenerate the workflows

They are pinned or tagged in master since #131464
and #131666.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants