Skip to content

Pin 05829 to query-based parallel replicas - #132867

Merged
nihalzp merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05829-pin-query-based-parallel-replicas
Nov 19, 2026
Merged

nihalzp merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/05829-pin-query-based-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #131450
Related: #132659
Related: #128413

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

05829_autopr_skip_index_on_read_in_subquery fails in every master run of Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel) since #128413 added that job: 05829_apply 0 instead of 1. With the job's parallel_replicas_plan_based = 1, automatic parallel replicas cannot match the shipped plan to the single-node plan (Cannot find step with matching hash ...), so it collects no statistics and never switches (#131450). The test now pins query-based parallel replicas, as 91d6019 did for 05175, so it keeps checking the #132659 fix in that job. No revert: the test and the job only conflict together.

Validation: with plan-based on, the unchanged test fails 10/10 (20/20 randomized) with the CI diff, passes 5/5 with the pin and fails again without the SET; 50/50 randomized runs pass with and without plan-based.

🤖 Generated with Claude Code


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

Version info

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

`Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel)`
sets `parallel_replicas_plan_based = 1` in the server profile. The test pins every
other parallel-replicas setting, so in that job only its implementation changes:
plan-based parallel replicas cannot match the shipped plan to the single-node plan
(`Cannot find step with matching hash ... in single-node plan`; the local plan has
one `Expression` under `Aggregating` where the single-node plan has two), so the
first run collects no statistics and the second never switches to the plan with
parallel replicas: `05829_apply 0` in every master run of the job.

Pin query-based parallel replicas, as 91d6019 did for 05175 (same class,
ClickHouse#131450), so the test keeps
checking the set transplant of ClickHouse#132659 in that job too.

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

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 1 finding).

# Sev Finding Verdict Evidence / action
1 ⚠️ The test checks that automatic parallel replicas switched plans, not that the skip index dropped granules DISAGREE Not this PR's change: the fixture and assertion come from #132659 and are untouched here. The crash it guards happens while the index is evaluated during the read, whether or not granules are dropped; #132659's Bugfix validation hit it on master without the fix.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-10:20261119-030800

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. On the CI amd_binary of master 51fdb0b1, tests/clickhouse-test 05829_autopr_skip_index_on_read_in_subquery --client-option parallel_replicas_plan_based=1 fails 10/10 without random settings and 20/20 randomized, with the CI diff (05829_apply 0).
b Root cause explained? The job's profile sets parallel_replicas_plan_based = 1, which the test did not pin. Plan-based parallel replicas then cannot match the shipped plan to the single-node plan (one Expression under Aggregating instead of two; log Cannot find step with matching hash ... in single-node plan, AutoParallelReplicasPlansNotComparable = 1), so the first run collects no statistics and the second never switches. Open class: #131450.
c Fix matches root cause? Yes. The test pins query-based parallel replicas, the implementation its assertion is about, the same way 91d6019 pinned 05175 for #131450. No bound widened, no no-* tag.
d Test intent preserved / new tests added? Yes. Parallel replicas stay enabled and the test still switches to the plan with parallel replicas, so it keeps checking the #132659 fix, now in the plan-based job too. Test-only change.
e Both directions demonstrated? Yes, same binary: unchanged test 10/10 FAIL, pinned 5/5 OK, pinned minus the SET line 5/5 FAIL again; 50/50 randomized OK with and without parallel_replicas_plan_based = 1.
f Fix is general across code paths? N/A (test pin, no product code).
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no product code); the 50/50 runs covered randomized settings.
h Backward compatible? (maintainer-approved exception only) Yes, no setting, default or format change; the SET is a no-op in every job where plan-based is already off.
i Invariants and contracts preserved? Yes. The session-level SET also applies to the IN subquery, so the subquery's setting cannot differ from the outer query's.

Session id: cron:clickhouse-impl-slot-6:20261119-024700

@clickhouse-gh

clickhouse-gh Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [94e368e]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel) FAIL
05043_autopr_set_source_leaf_steps FAIL cidb
05493_unique_key_disk_without_append FAIL cidb
01710_projection_with_mixed_pipeline NOT_FAILED cidb
05033_lazy_materialization_column_function_structure_equals NOT_FAILED cidb
04353_text_index_explicit_tokenizer_argument NOT_FAILED cidb

AI Review

Summary

Pins 05829_autopr_skip_index_on_read_in_subquery to query-based parallel replicas with parallel_replicas_plan_based = 0, avoiding the plan-comparison limitation tracked in #131450. The test retains its result checks and assertion that automatic parallel replicas actually switched plans, preserving coverage of the set skip-index regression. The author's recorded fail/pass/fail validation and repeated randomized passes support this narrow CI fix. Review of the current diff, surrounding implementation, and all prior discussion found no actionable issues.

Final Verdict

✅ Approve

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 94e368e

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel) / 05043_autopr_set_source_leaf_steps not from this PR (it only pins 05829_autopr_skip_index_on_read_in_subquery to query-based parallel replicas): with query_plan_remove_unused_columns = 0 automatic parallel replicas collects no statistics under the plan-based job (#131450), so both still_a_candidate lines are 0; passes 275/275 without random settings. Same red on 2 other PRs in this job since 2026-11-19 01:23Z #132876 (mine, open)
Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel) / 05493_unique_key_disk_without_append not from this PR: with optimize_trivial_count_query = 0 the plan-based job ships the read of a UNIQUE KEY table, which fails with SUPPORT_IS_DISABLED; passes 176/176 without random settings. Same red on 1 other PR in this job since 2026-11-19 02:17Z #132872 (mine, open)
PR praktika rollup of the two rows above #132876 and #132872 (mine, open)

The other CIDB FAIL rows on this head are Config Workflow / Pre Hooks of the run before the can be tested label. Mergeable Check is red only because of the rows above; CH Inc sync is green.

Session id: cron:our-pr-ci-monitor:20261119-063022

@nihalzp
nihalzp added this pull request to the merge queue Nov 19, 2026
Merged via the queue into ClickHouse:master with commit 195cde4 Nov 19, 2026
574 of 578 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 19, 2026
@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

can be tested Allows running workflows for external contributors comp-parallel-replicas Parallel reading from replicas for query speed (not data replication consistency). pr-ci 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