Repository navigation
Conversation
…lecting_sleep_ms The test pins merge_selecting_sleep_ms=1000 on its force-merge tables but leaves max_merge_selecting_sleep_ms at the default 60000. The merge-selecting task backs off geometrically on every CannotSelect poll and clamps up to max_merge_selecting_sleep_ms, so under TSan+S3+parallel pool starvation the poll interval grows to tens of seconds and the force-merge of an old partition is selected after the test's 100s wait budget, yielding 3 parts instead of 2. Cap max_merge_selecting_sleep_ms=2000 on the four force-merge tables (matching 02448_clone_replica_lost_part.sh and 02995_forget_partition.sh) so the worst case wait between selection attempts is 2s. test_without_merge is untouched. Closes: ClickHouse#107506 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260630-092600 |
|
cc @alesapin — could you review this test-only flaky fix? |
|
Workflow [PR], commit [df5e03e] Summary: ❌
AI ReviewSummaryThis PR only updates Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 100 line(s), 3 function(s) across 41 file(s) · Details Top files
|
CI finish ledger — df5e03eEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
This PR (#108916) is itself the test-only fix for the flaky Session id: cron:our-pr-ci-monitor:20260630-183000 |
|
Superseded: master commit e1d7ad5 ("Fix flaky test 02676_optimize_old_parts_replicated", merged 2026-07-12) already fixes this and closed #107506. That fix is a superset of this PR: besides capping |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Closes: #107506
02676_optimize_old_parts_replicatedis flaky: it intermittently prints3/extra rows instead of2at the "With merge replicated partition only" sections, predominantly onStateless tests (amd_tsan, s3 storage, parallel). Reruns always pass (timing flaky).Root cause: the test pins
merge_selecting_sleep_ms=1000on its force-merge tables but leavesmax_merge_selecting_sleep_msat the default60000. The merge-selecting task uses an adaptive backoff (StorageReplicatedMergeTree::mergeSelectingTask): everyCannotSelectpoll multiplies the sleep bymerge_selecting_sleep_slowdown_factor(1.2) and clamps it up tomax_merge_selecting_sleep_ms. While the freshly inserted partition is younger thanmin_age_to_force_merge_seconds, repeatedCannotSelectpolls inflate the interval; under TSan + S3 + parallel background-pool starvation it grows to tens of seconds (up to 60s), so once the part becomes eligible the next selection poll can be far beyond the test's 100swait_for_number_of_partsbudget and the force-merge has not happened yet.Fix: cap
max_merge_selecting_sleep_ms=2000on the four force-merge tables (the same pattern already used by02448_clone_replica_lost_part.shand02995_forget_partition.sh). This bounds the worst-case wait between merge-selection attempts to 2s while keeping the merge-selection logic exercised. Thetest_without_mergetable is left untouched (it must NOT merge). Neither setting is part of CI settings randomization, so this is deterministic.Validated locally (debug build, embedded Keeper): the merge-selecting interval inflates 1.3s -> 11s -> ... -> 60s without the cap, and is held at exactly 2s with it. All five sections reach their reference values within 1-3s with the fix.