Repository navigation
Fix flaky test 03001_consider_lwd_when_merge - #107812
alexey-milovidov merged 1 commit into
Conversation
The test calibrates the 80000-byte max_bytes_to_merge_at_*_space_in_pool thresholds against the on-disk size of a 10000-row UInt64 CODEC(NONE) part (10000 * 8 = 80000 bytes of column data). It relies on exclude_deleted_rows_for_part_size_in_merge scaling that size down by existing_rows/total_rows so the final OPTIMIZE can merge two otherwise too-large parts. The CI test runner randomizes MergeTree settings, including index_granularity over [1, 65536]. A small granularity multiplies the number of granules, so the per-granule overhead (marks files + primary.idx) inflates bytes_on_disk far beyond the 80000-byte data size: at index_granularity = 1 a 10000-row part is ~690 KB on disk instead of ~85 KB. The deletion-scaled size then stays above the threshold and the final OPTIMIZE fails with CANNOT_ASSIGN_OPTIMIZE. Pin index_granularity = 8192 (the default) in the CREATE TABLE SETTINGS so the part size matches what the byte thresholds were calibrated for. Explicit CREATE-level settings override the runner's randomized values, so the rest of the randomization is preserved. Reproduced on this PR's CI run via --index_granularity 1 (CANNOT_ASSIGN_OPTIMIZE); with the pin the test passes 50/50 over randomized index_granularity drawn from [1, 65536]. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-2:20260618-001500 |
|
cc @alexey-milovidov — could you review this? Per your request on #107457: pins |
|
Workflow [PR], commit [6751d65] Summary: ✅ AI ReviewSummaryThis PR fixes the randomized-settings flake in Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 406 line(s), 15 function(s) across 116 file(s) · Details Top files
|
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes flakiness of
03001_consider_lwd_when_mergeunder randomized MergeTree settings. Requested by @ alexey-milovidov in #107457 (comment).The test calibrates the
80000-bytemax_bytes_to_merge_at_{min,max}_space_in_poolthresholds against the on-disk size of a 10000-rowUInt64 CODEC(NONE)part (10000 * 8 = 80000bytes of column data). It relies onexclude_deleted_rows_for_part_size_in_mergescaling that size down byexisting_rows / total_rowsso the finalOPTIMIZEcan merge two otherwise too-large parts into one.The CI test runner randomizes MergeTree settings, including
index_granularityover[1, 65536]. A small granularity multiplies the number of granules, so the per-granule overhead (marks files +primary.idx) inflatesbytes_on_diskfar beyond the 80000-byte data size: atindex_granularity = 1a 10000-row part is ~690 KB on disk instead of ~85 KB. The deletion-scaled size then stays above the threshold, and the finalOPTIMIZE(which must succeed) fails withCANNOT_ASSIGN_OPTIMIZE.Fix: pin
index_granularity = 8192(the default) in theCREATE TABLESETTINGS so the part size matches what the byte thresholds were calibrated for. Explicit CREATE-level settings override the runner's randomized values, so the rest of the randomization is preserved.CI failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=107457&sha=77b6e9e71f92036d5855dedcf83435d1507431eb&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20s3%20storage%2C%20parallel%2C%202%2F2%29 (
Stateless tests (amd_tsan, s3 storage, parallel, 2/2), culprit setting--index_granularity 1). Reproduced locally; with the pin the test passes 50/50 over randomizedindex_granularitydrawn from[1, 65536].Version info
26.6.1.992