Repository navigation
Pin max_insert_threads = 1 in the polymorphic_parts_{s,m,l} performance tests - #127696
Conversation
Since ClickHouse#109006 (26.8) `max_insert_threads` defaults to auto, so each `INSERT ... SELECT` of these tests writes its 50-100 parts from 8 (amd) or 12 (arm) threads instead of one. A Wide part of the `hits_10m_single` schema is ~475 files; on the IOPS-capped CI disk the parallel writers wait for the write-back of the previous runs (OSIOWaitMicroseconds per INSERT 0.17 s -> 8 s, same OSWriteBytes and FileOpen), so every run is slower than the one before and the three tests became ranks ClickHouse#2, ClickHouse#3 and ClickHouse#5 of the noisiest performance tests on master (ClickHouse#100759), from 0% over the report floors before ClickHouse#109006. Pin the setting to 1, as ClickHouse#109006 documents for restoring the previous behavior. The queries, parts and files written are unchanged; parallel INSERT SELECT stays covered by parallel_insert.xml and insert_parallel.xml. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (2 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261024-070600 |
|
cc @CurtizJ, could you review this and add the |
|
Workflow [PR], commit [3729795] Summary: ✅
AI ReviewSummaryThe PR pins Findings
Tests
Final Verdict |
| <max_block_size>100</max_block_size> | ||
| <min_insert_block_size_rows>100</min_insert_block_size_rows> | ||
| <!-- Write the parts in one thread: parallel writers make each run wait for the disk writes of the runs before it --> | ||
| <max_insert_threads>1</max_insert_threads> |
There was a problem hiding this comment.
[P2] Validate the noise reduction on CI storage
The description explicitly says the local NVMe runs do not reproduce the CI disk regime, but this head's performance jobs are skipped because the PR is not labeled pr-performance. The local measurements support the thread-count change, but leave the actual CI write-back drift and noise reduction unverified. Please run performance CI for the three changed tests and compare their statistical thresholds and first-to-last-run drift with the unpinned results before merging. This needs measurements from the affected storage, rather than an additional test.
0970789
…wer run over run perf.py repeats every measured query on the same tables without a reset. A query that changes what its next run reads (a growing table, an UPDATE that rewrites its own rows, a file each run appends to) gets slower run over run and is then noisy on master for weeks: 8 of the 10 noisiest tests of the last round in ClickHouse#100759 were this class, all fixed after merge. A PR run could not notice: its status ignores slower/unstable rows, and the A/B diff of a new test mixes noise with the PR's own change. In master_head PR runs (not nightly, not the Iceberg configuration), read the job's own analyze/query-runs.tsv for the tests the PR adds or changes and fail Check Results when a query has, on the tested server, at least 5 runs with corr(run, time) > 0.8 and last/first > 1.2. Only the tested server counts: after the merge both master servers run that code, and requiring both servers drops recall to 0.34-0.94 of heads on last round's offenders against 0.60-0.98. One FAIL child per query carries both servers' run times. A missing file or a malformed row of a changed test fails the check; unknown changed files add a workflow warning instead. test_discovery.changed_tests is the selection, which changed_iceberg_tests now reuses. Validated on 16 real job logs: flagged on master before ClickHouse#127696 / ClickHouse#127380 and on all 8 head jobs of ClickHouse#119147, not flagged after the fixes, 1 of 273 tests on today's master (a query rising on both servers). Related: ClickHouse#100759 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #100759
Related: #109006
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The
polymorphic_parts_s,polymorphic_parts_mandpolymorphic_parts_lperformance tests setmax_insert_threads = 1, so eachINSERTwrites its parts in one thread, as it did before 26.8.Description
polymorphic_parts_m,_land_sare #2, #3 and #5 of the noisiest performance tests in #100759: over the report floors in 319, 289 and 156 of 672 query runs on master (2026-10-22..24), never flagged because the learned thresholds absorb it, e.g. amd_release 2/6 @ 3954b49b:polymorphic_parts_m#0 +31%, stat threshold 0.96.The noise starts at #109006 (
max_insert_threadsdefault 1 -> auto). For armpolymorphic_parts_m#0 the stat threshold is 0.06 on the merge's parent and 0.23-0.56 on the next five master commits; from April to June at most 1% of their query #0 runs were over the floors. EachINSERT ... SELECTnow writes its 50 to 500 parts from 8 (amd) or 12 (arm) threads, and a Wide part of this schema is about 475 files. On the CI disk they wait: per amdpolymorphic_parts_m#0INSERT,OSIOWaitMicrosecondswent from 0.17 s to 8 s for the sameOSWriteBytesandFileOpen. In m and l the Wide and Buffer inserts slow down run over run (the last of 7 runs takes 1.7-2.9x the first); s does not grow but is noisy too.The pin is the previous behavior, as #109006 documents. The queries, parts and files written are unchanged, and the inserts get slower, not faster. Parallel
INSERT SELECTstays covered byparallel_insert.xmlandinsert_parallel.xml.Validation: locally (CI release build, two servers, 5 x 7 runs per variant), the pin gives 2 thread pool jobs per
INSERTinstead of 12 with identical parts, files and bytes; all 9 queries have a stat threshold <= 0.10 in at least 4 of 5 invocations, and the mean last run is within 8% of the mean first. The CI disk regime does not reproduce on local NVMe, so this PR's own performance comparison is the real check.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127696]
Version info
26.11.1.763-master(included in26.11and later)