Skip to content

Pin parallel_replicas_min_number_of_rows_per_replica in 04839_parallel_replicas_cancel_before_announcement - #124341

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-04839-pin-min-rows-per-replica
Oct 7, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-04839-pin-min-rows-per-replica

Conversation

@groeneai

@groeneai groeneai commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

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):

The test 04839_parallel_replicas_cancel_before_announcement now pins parallel_replicas_min_number_of_rows_per_replica = 0, so its cancel queries keep using parallel replicas when that setting is randomized.

Description

Related: #71028

Failed on #71028, which randomizes parallel_replicas_min_number_of_rows_per_replica to 0 or 1, in Stateless tests (arm_binary, sequential) (report). The only diff is used_parallel_replicas 1 -> 0; the runner reproduced it 20/20 with the same settings and named this setting as the culprit.

Every cancel query in the test is SELECT k ... LIMIT 1. With the setting positive, the planner caps the row estimate at the trivial limit, sizes the read at one replica and disables parallel replicas (that job's server log has Disabling parallel replicas because there aren't enough rows to read for all five cancel queries). They then run single-node, and the used_parallel_replicas check added in #122773 correctly reports a run that tested nothing.

The setting is now pinned to 0 in the test's own SETTINGS, next to the automatic_parallel_replicas_mode = 0 pin for the other route to the same fallback. The reference is unchanged.

Validation (master debug build, CI server config):

  • Forced parallel_replicas_min_number_of_rows_per_replica=1, no other randomization: the old test fails 10/10 with the CI diff; the new one passes 5/5, every cancel query with ParallelReplicasUsedCount >= 1.
  • The new test with only the pin flipped to 1 fails 3/3.
  • 50/50 randomized runs with the setting forced to 1, and 20/20 without it.

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

Version info

  • Merged into: 26.10.1.1730-master (included in 26.10 and later)

Every cancel query in the test is `SELECT k ... LIMIT 1`. With a positive
`parallel_replicas_min_number_of_rows_per_replica`, the planner caps the
estimated rows at the trivial limit (1 row), sizes the read at 1 replica and
disables parallel replicas, so the `used_parallel_replicas` check reads 0.
Pin the setting to 0 next to `automatic_parallel_replicas_mode = 0`.

Related: ClickHouse#71028

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Oct 7, 2026
@groeneai

groeneai commented Oct 7, 2026

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), plus an own cold review (0 findings). Nothing to adjudicate.

Session id: cron:clickhouse-review-slot-9:20261007-003300

@groeneai
groeneai requested a review from devcrafter October 7, 2026 00:52
@clickhouse-gh

clickhouse-gh Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ac01dec]

Summary: ✅


AI Review

Summary

This PR makes 04839_parallel_replicas_cancel_before_announcement.sh deterministic by pinning parallel_replicas_min_number_of_rows_per_replica = 0, so the LIMIT 1 cancel queries keep exercising the parallel-replicas path even when CI randomizes that setting. The fix matches the existing planner behavior in both the query-tree and plan-based paths, preserves the test's intended coverage, and I did not find a remaining correctness or coverage gap in the current code.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 7, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 7, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 7, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 7, 2026
Merged via the queue into ClickHouse:master with commit f8811a6 Oct 7, 2026
149 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 7, 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). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai 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