Repository navigation
Prove the default codec of a Compact part from its shared data file - #119114
Conversation
An all-default-codec Compact part that lacks `default_compression_codec.txt` could not be attached: the codec proof resolved a column's data file through `getStreamNameForColumn`, which looks for per-column `.bin` files. A Compact part has none - every column is written into the shared `data.bin` - so nothing was proven for any column and the fallback that reads `checksums.txt` as a codec frame refused the part with `CORRUPTED_DATA`. A column literally named `data` was the exception, whose stream name coincides with the shared file; that coincidence is what kept `test_default_codec_for_compact_parts` passing. The Compact leg now resolves `data.bin` directly, which is what the comment above it describes: the first frame of the shared file proves the default codec once every stored column is known to be default-coded. Closes: #118323
|
Workflow [PR], commit [dae6ef6] Summary: ✅
AI ReviewSummaryThis PR fixes codec recovery for Final Verdict
LLVM Coverage ReportMeasured on commit dae6ef6.
Changed lines: Changed C/C++ lines covered: 15/16 (93.75%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 21 s compile time in total, 7 of them have a recent master baseline. |
… loads again The reviewer pointed out that the reproducer proved only the `ATTACH PART` half of the fix for a column not named `data`, while the integration test that reloads the table still used a column named `data`, the coincidental shape that masked the original bug. The stateless test now runs a third `clickhouse local` invocation after the part becomes active again, so the codec proof also runs on start-up for a part that has no `default_compression_codec.txt`, and it checks that `system.parts` reports the recovered codec as `UNKNOWN`. The integration test's column is renamed to `payload` so its `DETACH TABLE` / `ATTACH TABLE` path exercises the non-coincidental shape too. The test is renumbered from 05176 to 05227 to follow the tests added on master. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
🕵 The previous |
|
This failure is from 2026-09-24 (head The fix is already in progress:
|
alexey-milovidov
left a comment
There was a problem hiding this comment.
Ok, though the scenario is strange (why does it happen?)
An all-default-codec Compact part that lacks
default_compression_codec.txtcould not be attached:ATTACH PARTthrewCORRUPTED_DATAon a part whose data is intact, and the same detection runs when such a part is loaded.The Compact leg of the codec proof in
detectDefaultCompressionCodecresolved a column's data file throughgetStreamNameForColumn, which looks for per-column.binfiles. A Compact part has none - every column is written into the shareddata.bin- so the stream name was empty for every column, the loop proved nothing, and the fallback that readschecksums.txtas a codec frame rejected the part. The one column that resolved was a column literally nameddata, whose stream name coincides with the shared file, which is whytest_default_codec_for_compact_partspassed.The Compact leg now resolves
data.bindirectly, which is what the code's own comment describes: the first frame of the shared file proves the default codec once every stored column is known to be default-coded, as the check above it establishes. Wide parts keep the per-column proof.Closes: #118323
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixed
ATTACH PARTfailing withCORRUPTED_DATAfor a Compact part whosedefault_compression_codec.txtis missing, for example a part copied or restored without that file.Workflow [PR]
Sync PR [sync-upstream/pr/119114]
Version info
26.10.1.1373-master(included in26.10and later)