Repository navigation
Pin automatic_parallel_replicas_ignore_thresholds in 05617_autopr_undecided_retry - #133449
Merged
alexey-milovidov merged 1 commit intoNov 22, 2026
Conversation
…undecided_retry` The `ParallelReplicas` stateless job installs the automatic parallel replicas profile on every second commit (`parallel_replicas_job_runs_autopr`, odd SHA). That profile sets `automatic_parallel_replicas_ignore_thresholds = 1`, which drops the cap on how many threads a read can occupy. The third run of the warm case expects to decline from the remembered boundary without building the probe plan. With the cap on, the read of a few hundred KB occupies one thread, both sides of the cost model compare equal and the query declines. With the cap ignored, the comparison becomes `input / 4 > input / 12 + output / 3`, which favours parallel replicas whenever the duplicated-read ratio measured by the second run stays below 0.5. The measured input is bimodal across runs of the same statement (about 45 KB or 120-137 KB); in the high mode the third run builds the plan, applying it is refused because the single-node plan reads `t_undecided_wt` twice, and the run counts `AutoParallelReplicasPlansNotComparable`, so `undecided_warm_3` reads `1 0 0 1 0 1` instead of `0 0 0 0 0 1`. Pin the cap in the warm case, as `04035_autopr_no_parallel_replicas_for_small_reads` does. A query-level `SET` overrides the server profile. Locally, under the `--autopr` profile with the settings drawn by the two failing CI runs: 20/20 and 19/20 failures before, 0/50 and 0/50 after; 50 randomized runs each under the automatic and the plain parallel replicas profiles pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex): 0 findings. My own review of the diff: 0 findings (one wording fix in the description, applied before opening). Session id: cron:clickhouse-review-slot-10:20261121-224501 |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261121-222800 |
Contributor
|
Workflow [PR], commit [16b004f] Summary: ✅ AI ReviewSummaryPins Final VerdictStatus: ✅ Approve |
alexey-milovidov
approved these changes
Nov 22, 2026
Merged
via the queue into
ClickHouse:master
with commit Nov 22, 2026
afad0a9
387 of 389 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #130565
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
05617_autopr_undecided_retry(added in #130565) fails inStateless tests (amd_debug, ParallelReplicas, s3 storage, parallel)on two unrelated PRs (report 1, report 2), both times with onlyundecided_warm_3reading1 0 0 1 0 1instead of0 0 0 0 0 1.That job installs the automatic parallel replicas profile on every odd-SHA commit (
parallel_replicas_job_runs_autopr), and the profile setsautomatic_parallel_replicas_ignore_thresholds = 1. With the cap on how many threads a read can occupy, the small warm read is clamped to one thread on both sides, so the third run declines without building the plan, as the reference expects. With the cap ignored, the comparison favours parallel replicas, and the third run declines only while the duplicated-read share measured by the second run exceedsautomatic_parallel_replicas_max_duplicated_read_ratio. In the higher mode of the measured input (120-137 KB instead of about 45 KB) it does not: the third run builds the plan, applying it is refused because the single-node plan readst_undecided_wttwice, and the run countsAutoParallelReplicasPlansNotComparable.The warm case now pins
automatic_parallel_replicas_ignore_thresholds = 0, as04035_autopr_no_parallel_replicas_for_small_readsdoes; a query-levelSEToverrides the profile. Reverting #130565 (also in 26.10 and 26.11) would stop the failures too, but its code is not at fault.Locally (debug build, CI
--autoprprofile, settings of the two failing runs): 20/20 and 19/20 failures before, 0/50 and 0/50 after; 50 randomized runs each under the automatic and the plain parallel replicas profiles pass.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133449]
Version info
26.12.1.151-master(included in26.12and later)