Skip to content

Fix flaky test 02149_read_in_order_fixed_prefix - #125715

Merged
alexey-milovidov merged 3 commits into
masterfrom
fix-02149-fair-share-max-threads
Oct 15, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
fix-02149-fair-share-max-threads

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Since #125085, max_threads = auto is lowered to the fair share of CPU slots of ConcurrencyControl when other queries are running. Under the concurrent load of the test runner, the read in order of 02149_read_in_order_fixed_prefix (which sets max_threads = 0) can be planned with a single stream. Both parts are then read by one readInOrder call and EXPLAIN PIPELINE shows ReverseTransform × 2 instead of two separate chains. This is exactly the output of max_threads = 1.

The test now disables use_concurrency_control_for_max_threads, as its output depends on the number of streams.

It failed in the merge queue of #118315: https://github.com/ClickHouse/ClickHouse/actions/runs/38491344800/job/115617405459 (the next merge-queue entry, built on top of the same commit, passed).

Related: #125085
Related: #118315

Changelog category (leave one):

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

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.10.1.2510-master (included in 26.10 and later)
  • Backported to: 26.10.3.17

Since #125085, `max_threads = auto` is
lowered to the fair share of CPU slots of `ConcurrencyControl` when other queries are
running. Under the concurrent load of the test runner the read in order can be planned
with a single stream, so both parts are read by one `readInOrder` call and
`EXPLAIN PIPELINE` shows `ReverseTransform × 2` instead of two separate chains.

Disable `use_concurrency_control_for_max_threads` in the test, as its output depends on
the number of streams.

Failed in the merge queue of #118315:
https://github.com/ClickHouse/ClickHouse/actions/runs/38491344800/job/115617405459

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

clickhouse-gh Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4d071db]

Summary: ✅


AI Review

Summary

PR #125715, reviewed at 4d071dbba31a18ab8b6015312780cf3706e03b05, disables use_concurrency_control_for_max_threads in 02149_read_in_order_fixed_prefix to keep its asserted EXPLAIN PIPELINE topology stable under concurrent queries. No actionable findings.

Final Verdict

Status: ✅ Approve. No changes requested. The target test passed in current-head Fast test and the earlier parallel stateless run. Current-head parallel stateless jobs are still running.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The only failure, 02317_distinct_in_order_optimization_explain in Stateless tests (arm_binary, parallel) (https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125715&sha=0174bf0e4e9a72f590dac124ffbb095c8928cd03&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29), is unrelated to this change. It has the same root cause (fair-share max_threads from #125085) and is already being fixed in #125742. Merged the latest master.

robinld pushed a commit to robinld/ClickHouse that referenced this pull request Oct 14, 2026
Since ClickHouse#125085 an auto `max_threads` is lowered to the fair share of CPU
slots (`getEffectiveMaxThreads`). Under the test runner's concurrent load
the two `--max_threads=0` EXPLAIN PIPELINE checks of `algorithm: Thread`
can get a single stream; `ReadFromMergeTree` then reads in order
(`readInOrder` instead of `readFromPool`) and the line disappears. The
failing arm_binary job's server log shows `fair share of CPU slots 1
(32 requested)` for exactly the query that lost its line.

Pin `use_concurrency_control_for_max_threads = 0` on those two
invocations, as ClickHouse#125715 does for `02149_read_in_order_fixed_prefix`.
The other invocations do not depend on the number of streams.

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

Copy link
Copy Markdown
Member Author

🕵 The only failure, 04653_packed_part_size_accounting_no_read_in_commit in Stateless tests (arm_binary, AsyncInsert, s3 storage, parallel) (https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125715&sha=18f1d0b38de&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20AsyncInsert%2C%20s3%20storage%2C%20parallel%29), is unrelated to this change (a test-only change to 02149_read_in_order_fixed_prefix). It is a known flaky test (fewer_file_open assertion), and its fix is in progress in #118234. Merged the latest master.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov alexey-milovidov self-assigned this Oct 15, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit 9f36828 Oct 15, 2026
179 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-02149-fair-share-max-threads branch October 15, 2026 19:27
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 15, 2026
buggins added a commit to buggins/ClickHouse that referenced this pull request Oct 15, 2026
…-session-datatypes-125476

Takes ClickHouse#125715 (the flaky `02149_read_in_order_fixed_prefix` stopped the Fast test of the previous run).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@PedroTadim

Copy link
Copy Markdown
Member

Backporting to fix CI

@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 29, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 29, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 29, 2026
Backport #125715 to 26.10: Fix flaky test `02149_read_in_order_fixed_prefix`
leshikus pushed a commit that referenced this pull request Nov 13, 2026
@clickhouse-gh clickhouse-gh Bot added comp-query-optimizer Query plan optimization: physical plan steps, plan-level rewrites and optimizations (QueryPlan pa... 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

comp-query-optimizer Query plan optimization: physical plan steps, plan-level rewrites and optimizations (QueryPlan pa... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants