Skip to content

Pin 05628 and 05043 to query-based parallel replicas - #132876

Merged
devcrafter merged 1 commit into
ClickHouse:masterfrom
groeneai:pin-05628-05043-query-based-parallel-replicas
Nov 19, 2026
Merged

devcrafter merged 1 commit into
ClickHouse:masterfrom
groeneai:pin-05628-05043-query-based-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #131450
Related: #128413
Related: #132867

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

05628_autopr_transplant_repeated_table_occurrences (master) and 05043_autopr_set_source_leaf_steps (PR run) fail in the plan-based ParallelReplicas job added by #128413 when the randomizer draws query_plan_merge_filters = 0 (05628) or query_plan_remove_unused_columns = 0 (05043), about 5% of runs each. Automatic parallel replicas then cannot match the plan-based replicas plan to the single-node plan (Cannot find step with matching hash ... in single-node plan, #131450) and stops before collecting statistics or running the cost model. Both tests now pin query-based parallel replicas, as 91d6019 did for 05175, which had the same kind of randomized trigger. #118277 proposed this pin for 05043 and dropped it once plan-based could ship its IN set (93678b3); the new trigger needs it until #131450 is fixed. No revert: the job only exposes the open #131450.

Validation: with plan-based on and the trigger setting, both tests fail 5/5 with the CI diff, pass 20/20 with the pin and fail again without the SET; 50/50 randomized runs per test pass with and without plan-based.

🤖 Generated with Claude Code


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

Version info

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

Both tests failed in `Stateless tests (arm_binary, ParallelReplicas, plan-based,
s3 storage, parallel)`, the job ClickHouse#128413 added, whenever the randomizer drew
`query_plan_merge_filters = 0` (05628) or `query_plan_remove_unused_columns = 0`
(05043), each about 5% of runs. With `parallel_replicas_plan_based = 1`,
automatic parallel replicas then cannot match the probe plan to the single-node
plan (`Cannot find step with matching hash ... in single-node plan`,
`AutoParallelReplicasPlansNotComparable = 1`) and returns before the cost model
and before collecting statistics, so 05628's "declined after the cost model"
check and 05043's "still a candidate" check read 0. That is the open
plan-based gap ClickHouse#131450.

The tests are about query-based automatic parallel replicas, so pin that
implementation, the same way 91d6019 pinned 05175 for ClickHouse#131450. The pin is
a no-op in every job where plan-based parallel replicas is already off.

Related: ClickHouse#131450

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; 0 findings). No code changed after the review.

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

Session id: cron:clickhouse-review-slot-9:20261119-042000

@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 0553d8c5, tests/clickhouse-test <test> --no-random-settings --client-option parallel_replicas_plan_based=1 query_plan_merge_filters=0 (05628) or ... query_plan_remove_unused_columns=0 (05043) fails 5/5 with the CI diff.
b Root cause explained? The job's profile sets parallel_replicas_plan_based = 1, which neither test pinned. With one of the two settings off, the single-node plan and the plan with parallel replicas differ below the step the matcher looks for (05628: the single-node plan has an Expression between the t_occ_t read and its Filter, the other does not), so it logs Cannot find step with matching hash ... in single-node plan and returns with AutoParallelReplicasPlansNotComparable = 1, before the cost model and before any statistics. 05628 asserts a decline after the cost model, 05043 asserts collected statistics; both read 0. Open class: #131450.
c Fix matches root cause? Yes. The tests are about query-based automatic parallel replicas, and the pin selects that implementation, as 91d6019 did for 05175 for #131450. No bound widened, no no-* tag, no settings clamp.
d Test intent preserved / new tests added? Yes. Parallel replicas and the automatic mode stay enabled with the same settings in every job; the .reference files are unchanged. Test-only change.
e Both directions demonstrated? Yes, same binary: unchanged 5/5 FAIL each, pinned 5/5 and 20/20 OK, pinned minus only the SET line 5/5 FAIL again; 50/50 randomized OK per test with and without parallel_replicas_plan_based=1 (the trigger was drawn 5 and 3 times).
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 randomized runs covered the settings matrix.
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 reaches every subquery, so no subquery can carry a different parallel_replicas_plan_based; query_log shows 0 for every AutoPR query even with =1 injected.

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

@clickhouse-gh

clickhouse-gh Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [eed95d1]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_binary, ParallelReplicas, plan-based, s3 storage, parallel) FAIL
05829_autopr_skip_index_on_read_in_subquery FAIL cidb
05829_autopr_skip_index_on_read_in_subquery FAIL cidb
05829_autopr_skip_index_on_read_in_subquery FAIL cidb
04353_text_index_explicit_tokenizer_argument NOT_FAILED cidb
05395_autopr_nested_query_shapes NOT_FAILED cidb
05034_lazy_materialization_column_function_set_capture NOT_FAILED cidb
01283_max_threads_simple_query_optimization NOT_FAILED cidb
01710_projection_with_mixed_pipeline NOT_FAILED cidb

AI Review

Summary

Reviewed #132876 at eed95d1f4344a50a541aeee3e3aab95ce0d8af64. The change pins two automatic parallel replicas tests to query-based planning to avoid the plan-matching limitation tracked in #131450. Their existing result and profile-event assertions remain intact. The original CI failure reports confirm the stated randomized-setting triggers, and the author reports deterministic before/after and randomized validation. No actionable findings.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 19, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - eed95d1

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) / 05829_autopr_skip_index_on_read_in_subquery not from this PR (it changes only 05628_autopr_transplant_repeated_table_occurrences and 05043_autopr_set_source_leaf_steps): a deterministic red of this test under the plan-based parallel replicas job, on 11 master commits since 2026-11-19 00:41Z (master report) and on 42 other PRs #132867 (mine, open)
PR praktika rollup of the row above #132867 (mine, open)

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

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

@devcrafter devcrafter self-assigned this Nov 19, 2026
@devcrafter
devcrafter added this pull request to the merge queue Nov 19, 2026
Merged via the queue into ClickHouse:master with commit 0643663 Nov 19, 2026
574 of 578 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 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