Skip to content

Pin enable_adaptive_codec_selection in 05293_autopr_statistics_plan_based - #133069

Merged
nickitat merged 1 commit into
masterfrom
fix-05293-adaptive-codec
Nov 19, 2026
Merged

nickitat merged 1 commit into
masterfrom
fix-05293-adaptive-codec

Conversation

@nickitat

@nickitat nickitat commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

05293_autopr_statistics_plan_based fails whenever stateless tests randomize enable_adaptive_codec_selection = 1, which they do since 8d693e5. The AutoPR cost model works off estimated compressed bytes, so adaptive codecs change whether the second run adopts parallel replicas (second_run_used_replicas becomes 0). CI's settings minimizer names enable_adaptive_codec_selection 1 together with query_plan_join_swap_table false.

Pin enable_adaptive_codec_selection = 0 on both tables, the same way the sibling 05262_autopr_statistics_follow_coordinated_read was pinned in 82c9514. Verified locally: with the culprit settings it fails 3/3 with 1 and passes 3/3 with 0; 10/10 under randomization.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
Related: #129544
Related: #125888

Changelog category (leave one):

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

🤖 Generated with Claude Code


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

Version info

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

…_plan_based`

The cost model works off estimated compressed bytes, and adaptive codec selection,
now randomized in stateless tests, changes them, so the second run stops adopting
parallel replicas. The sibling `05262` was already pinned the same way.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=129544&sha=10b2b5fe60611b692e06c8babb025f3cc4dbebca&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
PR: #129544

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 52da073)
@clickhouse-gh

clickhouse-gh Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a6c84af]

Summary: ✅


AI Review

Summary

The PR pins enable_adaptive_codec_selection = 0 on both MergeTree tables in 05293_autopr_statistics_plan_based, stabilizing the compressed-byte estimates used to decide whether to adopt parallel replicas. The change preserves the existing statistics, replica-use, and result-correctness assertions. The original CI diagnosis identifies the pinned setting as a culprit, and the PR reports successful focused and randomized reruns. No actionable findings.

Missing context / blind spots
  • ⚠️ No local ClickHouse binary or build is available, and the current PR's Stateless tests (arm_binary, parallel) report exposes no test results yet. Runtime validation relies on the original CI diagnosis and the author's reported reruns; a passing run of the modified test in that job would independently confirm the fix.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Nov 19, 2026
@nickitat
nickitat enabled auto-merge November 19, 2026 20:54
@devcrafter devcrafter self-assigned this Nov 19, 2026
@nickitat
nickitat added this pull request to the merge queue Nov 19, 2026
Merged via the queue into master with commit 22cb52b Nov 19, 2026
384 of 385 checks passed
@nickitat
nickitat deleted the fix-05293-adaptive-codec branch November 19, 2026 23:35
@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
PedroTadim pushed a commit to groeneai/ClickHouse that referenced this pull request Nov 20, 2026
The scheduler avoids deadlocks by always letting the first incomplete row group
schedule its tasks, whatever the memory usage. Since e7a7ac3 this exemption
applied only from `ColumnData` on. Before that, a later row group could get through
the bloom filter and `Dictionary` stages first and hold the `Dictionary` stage's
memory. The first incomplete row group then waited for that memory in `Dictionary`,
while the later row group waited in `ColumnData` to become first, and the reader threw
`Deadlock in Parquet::ReadManager`. This is reachable with a small
`input_format_parquet_memory_high_watermark`, which CI randomizes since ClickHouse#132712.

The stages before `ColumnData` handle the whole row group at once, so the first
incomplete row group is privileged in them unconditionally, as it was before
e7a7ac3.

The new test deadlocked in 4 of 10 runs without the fix, and passed 20 of 20
(with and without settings randomization) with it. In a `clickhouse-local` stress
run on a 298-row-group file: 100 deadlocks in 6000 runs before, 0 in 6000 after.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=133069&sha=a6c84af029f9bdc3526b34b1df2eae0b4b281294&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20plan-based%2C%20s3%20storage%2C%20parallel%29
PR: ClickHouse#133069
Closes: ClickHouse#133046

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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