Skip to content

Stabilize apply_patch_parts_join performance test - #105527

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
Algunenano:fix-apply-patch-parts-join-flakiness
May 23, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
Algunenano:fix-apply-patch-parts-join-flakiness

Conversation

@Algunenano

@Algunenano Algunenano commented May 21, 2026 •

Copy link
Copy Markdown
Member

Refs #100759.

The point-lookup queries (#4-#7) in apply_patch_parts_join were flagged in #100759 as showing 18-30% noise on master runs. Root cause: the four lightweight UPDATE statements run with default max_threads, so parallel threads race into the patch builder and the patch-part split boundary lands at a different row count on every run. The point-lookup queries read a single base granule plus whatever patch granules cover it, so a varying split changes PatchesReadRows from 131072 to 327680 across runs of the same fill, and timings vary correspondingly.

Force the INSERT and the four UPDATEs to use a single thread, and set the insert block size large enough that the 10%-update patches stay in one part. Locally verified deterministic PatchesReadRows over 20 cycles for all four point-lookup queries. Setup time goes from ~4.2s to ~6.3s. The scan queries (#0-#3) still detect injected regressions in the patch-apply path (verified with a busy-wait at the top of applyPatchesToBlock: q0-q3 showed 12-23% slower, p<0.05; q4-q7 remained stable as expected).

Changelog category (leave one):

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

Version info

  • Merged into: 26.6.1.112

The point-lookup queries (ClickHouse#4-ClickHouse#7) in apply_patch_parts_join produced
18-30% test noise because the four UPDATE statements that build the
patch parts ran with default parallelism. Parallel threads racing into
the patch builder produce different patch-part split boundaries on
every run, which changes how many patch granules a point lookup at
id=5000000 ends up reading. Per-server timing then depends on the
random split, not on the code being measured.

Force INSERT and UPDATE to use a single thread plus a block size large
enough to fit each whole patch, so the patch-part layout is the same
on every run. Locally verified deterministic over 20 cycles. Setup
time goes from ~4.2s to ~6.3s. Scan queries (#0-ClickHouse#3) still detect
patch-apply-path regressions as before.

Refs ClickHouse#100759.
@clickhouse-gh

clickhouse-gh Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4b80cd2]

Summary: ✅


AI Review

Summary

This PR stabilizes tests/performance/apply_patch_parts_join.xml by making the data setup deterministic (max_insert_threads=1 for the initial insert and constrained single-threaded updates with explicit block sizing). I reviewed the current diff, current file state, and prior PR discussion history; I did not find unresolved correctness, safety, or performance-review issues that warrant inline comments.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 21, 2026
@Algunenano Algunenano added ci-performance performance only and removed ci-performance performance only labels May 22, 2026
@alexey-milovidov alexey-milovidov self-assigned this May 23, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue May 23, 2026
Merged via the queue into ClickHouse:master with commit f2f818b May 23, 2026
166 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 23, 2026
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
…parts-join-flakiness

Stabilize apply_patch_parts_join performance test
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