Repository navigation
Conversation
…r MSan The file hit the 600 s per-file timeout on an MSan lane with Keeper metadata and S3 storage. Public CI has no timeouts on it in 90 days, so the problem is cost rather than correctness, and the cost has two separate halves. Four of the five abandon cases were sized by the arming threshold rather than by what they assert. DeduplicationAbandonController decides per stream only once it has seen five chunks or 16 MiB, so with eight partitions and an 8192-row granule the chunk-window floor is 5 x 8 x 8192 = 327,680 rows, and test_in_mostly_unique sat at 1.22x that floor: its row count could not be cut until the floor was. Lowering the granule to 512, or the stream count to two where the granule cannot move, drops the floor first and lets the rows follow, 3,511,700 -> 722,400 in total. Each case that moves to two partitions also pins max_threads to two, because the per-partition read allocates max_threads / partitions readers per partition and only a single reader per partition keeps the separately inserted head part ahead of the tail part, which the head-anchored rate arguments depend on. test_in_wide_keys instead keeps the default granule and is sized to fewer than five chunks per stream, so the only arm that can fire there is the 16 MiB observation byte cap, and its assertion isolates that cap instead of merely observing an abandon. Measured per statement, mean of two runs on the same server: the four cases go from 8,707 ms to 2,733 ms on MSan and from 1,673 ms to 414 ms on debug. The second half is not data volume. Only 61.5% of the MSan runtime was in the five abandon cases; the rest is the twenty small cases above them, 160 statements over 400-960-row tables, which is per-statement structure that no resizing reduces and which a lane turning every DDL into a Keeper round trip makes expensive. The whole file therefore improves by 1.52x on MSan (16,953 -> 11,146 ms) and 1.84x on debug (2,764 -> 1,504 ms), and 75% of what remains is that structure plus test_in_lc_dup_prefix. That is not enough headroom to trust a 600 s per-file gate on the reporting lane, so the file also carries no-msan, the same shape as ClickHouse#117833. The abandon path keeps its MSan coverage in 05046_creating_set_deduplication_abandoning_event and 05045_preliminary_distinct_abandoning, which assert the same profile event and cost 51.8 s at worst there. The abandon cases also asserted nothing about abandoning: result equality between allow_creating_set_partitions_independently 0 and 1, and a max_rows_in_set equal to the exact unique count, both hold whether or not a stream abandoned, so a resizing could have disarmed a case with the suite green. One statement now reads DistinctTransformsAbandonedDeduplication for all four cases in a single query_log scan, three asserting 1 and test_in_dup_head_unique_tail asserting 0, so the four control each other. Each was shown to flip under a named mutation, and disarming one in the file turns the file red with only that case's row changed. test_in_lc_dup_prefix is deliberately unchanged: its LowCardinality empty-mask arm has no control that can be shown to fail, since the source-side mutation cannot move the rate past the 0.9 threshold at any size that also makes the case cheaper, and arming it would need roughly 184,000 tail rows against today's 100,000. It is left exactly as master has it and this change claims nothing about its arming. Related: ClickHouse#119634 (comment) 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; 2 findings) plus my own cold
Noted, not blocking: an exact-count form of the assertion ( Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20260914-181230 |
|
Workflow [PR], commit [2870a16] Summary: ✅ AI ReviewSummaryThis PR shrinks the expensive abandon-path fixtures in Final VerdictStatus: ✅ Approve |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20260914-173037 |
CI finish ledger - 1b47919Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
Diagnosis, from the runner's own randomized-settings minimization rather than inferred: re-running Not reachable from this diff: this pull request changes exactly two files, CI is finished on this head: every praktika check-run is Session id: cron:our-pr-ci-monitor:20260914-220033 |
|
Fixing PR for every I am not opening a competing fix on the same file. That PR's own CI has 256 OK rows for this test and 0 failures, 250 of them flaky-check repeats across five build flavours, and I reproduced its shape locally at 150/150 (five of the minimized culprit values at 20 runs each, plus 50 fully randomized runs). Nothing on this branch is implicated either way: it changes only Session id: cron:clickhouse-plan-slot-0:20260914-222800 |
|
Already fixed in sync. |
Related: #119634 (comment)
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Make
04669_creating_set_partitions_independentlycheaper, assert the deduplication-abandon decision it was silently relying on, and stop running it under MSan.Description
04669_creating_set_partitions_independentlyhit the 600 s per-file timeout on a private MSan lane with Keeper metadata and S3 storage (linked comment). Public CI has 0 timeouts on it in 90 days, so this is about cost. I measured where that time goes first, per statement and per case (table below).Four of the five "abandon" cases were sized by an arming threshold rather than by what they assert:
DeduplicationAbandonControllerdecides per stream only after 5 chunks or 16 MiB, so at 8 partitions and an 8192-row granule the floor is5 x 8 x 8192 = 327,680rows, andtest_in_mostly_uniquesat at 1.22x it. Lowering the granule, or the stream count, first lets the rows follow: 3,511,600 -> 722,400 rows, those four cases 3.2x cheaper on MSan.Only 61.5% of the MSan runtime was in those cases, though. The other 38.5% is the ~20 small cases above them: 160 statements over 400-960-row tables, per-statement structure that no resizing reduces and that a Keeper-metadata lane makes expensive. Whole file: 16,953 -> 11,146 ms (1.52x) MSan, 2,764 -> 1,504 ms (1.84x) debug.
1.52x is not enough to trust a 600 s per-file gate when 75% of the remainder is that structure plus the untouched
test_in_lc_dup_prefix, so the file also getsno-msan, the shape of #117833.05046_creating_set_deduplication_abandoning_eventand05045_preliminary_distinct_abandoningkeep asserting the same abandon path under MSan.Those cases also asserted nothing about abandoning: result equality and the
max_rows_in_setbound hold either way. They now assertDistinctTransformsAbandonedDeduplication, withtest_in_dup_head_unique_tailas the in-file0control, and disarming any of the four turns the file red.test_in_lc_dup_prefixis left as it is: its LowCardinality empty-mask arm has no control that can be shown to fail, and arming it would mean growing it.04411_distinct_partitions_independently(272.4 s, same lane) would take the same treatment; say the word.Measured cost per case, mean of two runs each, same server and build (click to expand)
sum(query_duration_ms)fromsystem.query_log, grouped by the case whose table each statement names. MSan buildsanitize=memory, debug build, master's version of the file versus this one, back to back.test_in_wide_keystest_in_dup_head_unique_tailtest_in_small_dup_headtest_in_mostly_uniquetest_in_lc_dup_prefix(untouched)Runner wall clock over the same runs: MSan 18.49 s -> 12.74 s, debug 3.14 s -> 2.09 s. Public CIDB, 90 days: worst lanes are
amd_debug, flaky check390.4 s max andamd_msan, WasmEdge, parallel, 2/3288.8 s max / 124.1 s p50 over 1501 runs, with 0 timeouts and 0 error rows. Stability: 50 runs, 0 failures.Workflow [PR]
Sync PR [sync-upstream/pr/120055]