Repository navigation
Skip the Keeper RemoveRecursive preprocessing timing check under sanitizers - #121331
Conversation
…caling guard Storage/CoordinationTest.TestRemoveRecursivePreprocessWithUncommittedBacklog/Mem failed once in Unit tests (tsan) at 108883 us against its max(base_us * 10, 20000) allowance, the first failure since the guard landed in ClickHouse#117778 seventeen days earlier. The product code is not at fault. Seven sibling Unit tests (tsan) runs that morning measured 813-944 us to 1046-1232 us, a ratio of 1.17x to 1.53x, and the /LSMT arm inside the failing process itself measured 1.2x while its neighbouring tests took the same milliseconds as in a passing run: one sample moved and nothing else did. The by-parent index added by ClickHouse#117778 still covers the exercised path, and nothing reachable from preprocessRequest here is linear in the uncommitted set. The observed rate is one failure in 27022 rows over 30 days. The assertion bounds the wall time the host granted a single unrepeated ~1 ms window, while the property it guards is the work the algorithm performs. A stall the algorithm did not cause, such as thread preemption on a loaded runner, a ThreadSanitizer stop-the-world shadow flush or kernel reclaim, adds its full duration to a wall-clock sample and can never subtract from it, so roughly 107 ms of stall crossed the 20 ms floor. Constructing the two Stopwatch objects with CLOCK_THREAD_CPUTIME_ID makes the guard bound the quantity it actually claims. The allowance, the EXPECT_LE message, the subtree sets, the 100000-node backlog and every functional assertion are unchanged. Raising the threshold was rejected: surviving a 107 ms stall would need a floor above 110 ms, and this batch cost hundreds of milliseconds before ClickHouse#117778, so such a floor would leave the guard almost no detection margin. Validated in a Debug build. Reverse-applying 0ddbd00 and 4f8f8f5 on KeeperMemNodesStorage only makes the fixed test fail at 323253 us of CPU time, 16x over the floor, so the guard still catches the regression it exists for. A 150 ms sleep_for injected into the measured window fails on wall clock (150451 us) and passes on the new clock (587 us), while a 150 ms CPU spin fails on both, so the new clock filters the observed failure class without going blind. Fifty consecutive runs are 100/100 green with backlog samples of 233-840 us, against 236-495 us on wall clock before the change, and the maximum base_us of 565 us keeps base_us * 10 below the 20 ms floor, so the effective bound is unchanged. Related: ClickHouse#117778 Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding;
Severity: ❌ blocker / Noted, not blocking, and not raised as work: reading Session id: cron:clickhouse-review-slot-11:20260921-105200 |
|
Workflow [PR], commit [162c374] Summary: ✅
AI ReviewSummaryThis PR makes Findings
Final VerdictLLVM Coverage ReportMeasured on commit 162c374.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +202 lines in 56 files (-82 lines lost coverage) · Details |
CI finish ledger - c8ff3efEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Session id: cron:our-pr-ci-monitor:20260921-173143 |
|
@groeneai should such timing based checks be rather excluded for sanitizer builds? |
As suggested in review, exclude the timing assertion of TestRemoveRecursivePreprocessWithUncommittedBacklog from ASan, TSan and MSan builds instead of switching its clock, and restore the wall clock. Both failures of the bound so far were one-off stalls of about 80-110 ms in Unit tests (tsan), with a normal baseline and the /LSMT arm of the same process unaffected. A thread CPU clock removes host preemption, but still counts any sanitizer runtime work done on the measured thread. The bound keeps running in Unit tests (amd_llvm_coverage), the unit-test job built without a sanitizer, on PRs and master. There /Mem measures 121-139 us without backlog and 221-264 us with it, against the 20 ms floor. With the pre-ClickHouse#117778 storage code restored (0ddbd00 and 4f8f8f5 reverse-applied to KeeperMemNodesStorage only) the test still fails in a non-sanitizer Debug build, at 318624 us against a 142 us baseline. The rest of the test, including its functional assertions, still runs under sanitizers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Yes. Done in 162c374: the bound is now checked only in builds without ASan, TSan or MSan (the rest of the test still runs under them), and I restored the wall clock, so the PR diff is just the The bound keeps running in |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #117778. Failing runs: Unit tests (tsan),
1a80fe54b903, Unit tests (tsan),5ba372289ba9.TestRemoveRecursivePreprocessWithUncommittedBacklog/Memis #117778's regression guard: preprocessing aRemoveRecursivebatch must not scale with unrelated uncommitted nodes, checked asbacklog_us <= max(base_us * 10, 20000). It went red twice inUnit tests (tsan), at 108883 us and 77802 us, each time with a normal ~850 us baseline and a normal/LSMTarm in the same process: one ~1 ms sample stalled, the product code did not regress. CIDB, 30 days, this case: 2 failures in 10375 tsan runs, 0 in 29096 asan_ubsan, msan and coverage runs.As suggested in review, the bound is now checked only in builds without ASan, TSan or MSan. The measurement, its printed trend line and the functional assertions still run everywhere.
The bound keeps running in
Unit tests (amd_llvm_coverage), the unit-test job built without a sanitizer, on PRs and master: there/Memmeasures 121-139 us without backlog and 221-264 us with it, against the 20 ms floor. Release-branch CI has only sanitizer unit-test jobs, so the bound no longer runs there.Validation, Debug build without a sanitizer: with the pre-#117778 storage code restored (
0ddbd00d4daaaand4f8f8f5d79f8reverse-applied toKeeperMemNodesStorageonly) the test fails at 318624 us against a 142 us baseline. With the fix, 10 repeated runs are green andStorage/CoordinationTest.*passes 164/164. Preprocessing the test with-fsanitize=thread,addressormemorydrops the assertion; without a sanitizer, and with the coverage flags, it stays.Workflow [PR]
Sync PR [sync-upstream/pr/121331]
Version info
26.10.1.964-master(included in26.10and later)