Repository navigation
Fix flaky 04256_packed_skip_indices_layout_transitions under randomized sparse serialization - #109095
Conversation
…ed sparse serialization The test walks a single skip index through packed -> spilled -> repacked transitions and detects the spill by comparing system.parts.files (the total part file count) of the phase-3 (spilled) merged part against the phase-2 (packed) merged part, asserting phase 3 has strictly more files. It assumes the two parts differ only in the skip-index layout. That assumption breaks under CI's randomized ratio_of_defaults_for_sparse_serialization. A low ratio makes ClickHouse decide sparse serialization per column per part based on that part's data. The phase-2 part (3072 rows) and the phase-3 part (13312 rows, different values) then disagree on whether the id/w columns are sparse-serialized, adding or removing per-column substream files (id.sparse.idx.bin, id.sparse.idx.cmrk2, ...). That column-file delta is unrelated to the index and can cancel or outweigh the +1 file from the index spill, so phase3_spilled_has_more_files_than_packed flips to 0 and the test fails. CI's own random-settings diagnosis isolated the single culprit (ratio_of_defaults_for_sparse_serialization = 0.0013...): 22/22 fail with it, 35/35 pass without it. Pin ratio_of_defaults_for_sparse_serialization = 1.0 in the table's CREATE SETTINGS so column serialization is dense and identical across phases; the file-count delta then reflects only the index layout, which is what the test measures. A table-level SETTINGS value overrides the runner's --allow_merge_tree_settings injection, so the pin is immune to randomization. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260701-214500 |
|
cc @Algunenano — could you review? You authored this test and the packed-skip-index packing logic (52c7427). It is flaky under randomized |
|
Workflow [PR], commit [abe08ce] Summary: ✅ AI ReviewSummaryThis PR pins Final Verdict
|
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 125 line(s), 6 function(s) across 46 file(s) · Details Top files
|
CI finish ledger - abe08ceEvery failure below has an owner (a fixing PR). None is PR-caused: this PR is a test-only change (pins
Session id: cron:our-pr-ci-monitor:20260702-050000 |
317f388
Backport #109095 to 26.6: Fix flaky 04256_packed_skip_indices_layout_transitions under randomized sparse serialization
…-sparse-serialization-file-count Fix flaky 04256_packed_skip_indices_layout_transitions under randomized sparse serialization
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
04256_packed_skip_indices_layout_transitionswalks a single skip index through packed -> spilled -> repacked transitions and detects the spill by comparingsystem.parts.files(the total part file count) of the phase-3 (spilled) merged part against the phase-2 (packed) merged part, asserting phase 3 has strictly more files. It assumes the two parts differ only in the skip-index layout.That assumption breaks under CI's randomized
ratio_of_defaults_for_sparse_serialization. A low ratio makes ClickHouse decide sparse serialization per column per part based on that part's data. The phase-2 part (3072 rows) and the phase-3 part (13312 rows, different values) then disagree on whether theid/wcolumns are sparse-serialized, adding/removing per-column substream files (id.sparse.idx.bin,id.sparse.idx.cmrk2, ...). That column-file delta is unrelated to the index and can cancel or outweigh the +1 file from the index spill, sophase3_spilled_has_more_files_than_packedflips to 0 and the test fails.CI's own random-settings diagnosis isolated the single culprit
ratio_of_defaults_for_sparse_serialization = 0.0013...: 22/22 fail with it, 35/35 pass without it. Reproduced locally with that exact value: phase2 part = 12 files vs 10 without it, while phase3 stays at 11, flipping the assertion.Fix: pin
ratio_of_defaults_for_sparse_serialization = 1.0in the table'sCREATE ... SETTINGSso column serialization is dense and identical across phases; the file-count delta then reflects only the index layout, which is what the test measures. A table-levelSETTINGSvalue overrides the runner's--allow_merge_tree_settingsinjection (ClientBase::addMergeTreeSettingsonly adds settings not already present), so the pin is immune to randomization. The.referenceoutput is unchanged.Validated with the official
clickhouse-testharness: forcing the culprit setting, the unfixed test fails with exactly-phase3_spilled_has_more_files_than_packed 1/+...0; with the fix it passes 20/20; and 50/50 runs pass with full randomization enabled.Report of a failing run: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=104927&sha=1ee52dfe467a323c97bbf48f3e2be1da35db58f0&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29
Version info
26.7.1.425(included in26.7and later)26.6.2.24