Repository navigation
Conversation
|
Workflow [PR], commit [2f94b2f] Summary: ✅
AI ReviewSummaryThis PR adds PR Metadata
Findings❌ Blockers
Final VerdictChanges requested. |
Previous run passed the change-related checks, but failed on unrelated fuzz/stress failures: - AST fuzzer: `Logical error: row < chunk.getNumRows()` - Stress test `arm_msan`: `Block structure mismatch in A stream` - BuzzHouse `arm_asan_ubsan`: `Distributed task iterator is not initialized` - Stress test `amd_asan_ubsan`: ASan in `StringHashTable`/`PositionListBuilder`
Store per-column codec descriptions in part metadata and use them before falling back to compressed stream headers. Preserve the metadata during mutations and gate it behind a new replication protocol version. Tested with: ninja -C build_local clickhouse Tested with: build_local/programs/clickhouse local --multiquery < tests/queries/0_stateless/04416_system_parts_columns_compression_codec.sql
Read `system.parts_columns.compression_codec` from per-part `column_compression_codecs.txt` metadata when it is available, and leave the value empty for legacy parts without exact metadata. During mutations, preserve existing sidecar entries and overlay codecs only for semantically changed columns. Also include `column_compression_codecs.txt` in fast part removal and add focused stateless coverage for legacy sidecars and materialized-column codec changes.
The new per-part `column_compression_codecs.txt` file is synced together with the rest of the inserted part files, so `02361_fsync_profile_events` should expect one additional `FileSync` event. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=48ae9d3238e2d9ec3de6ba89f88a5f18e912dffb&name_0=PR&name_1=Fast%20test PR: ClickHouse#108775
Collect codec metadata from vertical merge column streams before finalizing the part, and add a regression test for gathered columns. Also make the codec stateless tests deterministic under random MergeTree settings and fix the arm_tidy warning in the mutation codec metadata helper. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=99ada652d291796963b215add9314b66621b6769&name_0=PR&name_1=Build%20%28arm_tidy%29 Related: ClickHouse#108775
Account for column_compression_codecs.txt in S3 plain part listings and the extra FileOpen event from writing codec metadata. CI reports: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=669d1589cbb3bcecd7b8ca10f79a362ecad0c14e&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 CI reports: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=669d1589cbb3bcecd7b8ca10f79a362ecad0c14e&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 Related: ClickHouse#108775
For compact and non-full mutations, preserve source column compression metadata first, then overlay the codecs reported by the writer for every column physically written into the new part. This keeps hardlinked wide columns on their source metadata while avoiding stale sidecar entries for compact streams rewritten as internal read columns. Add a focused stateless regression for a compact part whose column codec changes from LZ4 to ZSTD(3) before mutating another column. Related: ClickHouse#108775 Related: ClickHouse#108775 (comment)
Account for the `column_compression_codecs.txt` sidecar in S3/plain drop-table listings, filesystem-cache file counts, and S3 request counts. Normalize trailing blank lines from `clickhouse-disks` in the `02980` S3 plain tests. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=400e7a6b09c23a2e84f2a608af58925f892a0307&name_0=PR Related: ClickHouse#108775
Update the `02980` references after normalizing trailing blank output from `clickhouse-disks`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=78eb4e411ad5cba2036bd03df1fa0ea580378126&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20targeted%29 CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108775&sha=78eb4e411ad5cba2036bd03df1fa0ea580378126&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 Related: ClickHouse#108775
Build the final-to-original rename mapping when copying per-column codec sidecar entries for mutated parts, so pure rename mutations keep exact codec metadata under the final storage column name. Add a stateless regression that queues chained pure renames and verifies `system.parts_columns.compression_codec` for the final column. Bot comment: ClickHouse#108775 (comment) Related: ClickHouse#108775
|
Dear @scanhex12, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
…-compression-codec # Conflicts: # src/Storages/MergeTree/DataPartStorageOnDiskBase.cpp # src/Storages/MergeTree/DataPartsExchange.cpp # src/Storages/MergeTree/MutateTask.cpp # src/Storages/System/StorageSystemPartsColumns.cpp # tests/queries/0_stateless/02117_show_create_table_system.reference
`system.parts_columns.compression_codec` is served entirely by `IMergeTreeDataPart::getColumnCompressionCodecDescription`, which reads the exact codec descriptions from `column_compression_codecs.txt` and reports an empty value when that file is absent. The earlier iteration of this PR reconstructed a codec from the compressed block header of the data stream. That path lost codec parameters (`ZSTD(3)` was reported as `ZSTD(1)`, `LZ4HC(9)` as `LZ4`) and was superseded by the metadata file, but the code was left behind with no callers: * `IMergeTreeDataPart::getColumnCompressionCodec` and its `MergeTreeDataPartWide` / `MergeTreeDataPartCompact` overrides, * `MergeTreeDataPartCompact::loadColumnCompressionCodecs` together with its per-part codec cache and mutex, * the `offset_in_compressed_file` overload of `getCompressionCodecForFile`. Removing them also removes a stale `MergeTreeMarksLoader` construction that no longer matched the constructor after `use_streaming_compression_` was added on master, which is what broke the build.
`MutationsInterpreter::getColumnsChangedByMutation` has no callers: the codecs of a mutated part are collected from the writer itself in `collectColumnCompressionCodecsForMutatedPart`, not from the interpreter's view of which columns a mutation touches. The `read_for_internal_compact_mutation` flag on `MutationCommand` existed only to keep the internal `READ_COLUMN` commands that carry unchanged data through a compact-part rewrite out of that set, so it goes away with it.
The column list in `parts_columns.md` was missing `estimates.default_count`, which master added to `system.parts_columns` while this PR was open.
… part Persisting the exact codec of every column of every part cost one extra file (`column_compression_codecs.txt`) in every MergeTree part: one more object and one more `PUT` per part on object storage, ~100 more bytes of part metadata, a new replication protocol version, and matching entries in the fetch, hardlink and directory-removal paths. That is a lot of permanent write-path overhead for an observability column. Report instead what the column resolves to now: its own `CODEC(...)` from the table metadata when it has one, and the part's default compression codec (already persisted in `default_compression_codec.txt`) otherwise. The value is therefore exact for every part that has not survived a codec change, and follows the current definition for the ones that have. This reverts all of the write-path machinery, the replication protocol bump and the test expectations that counted the extra file.
|
🕵 Rebased on master (conflicts with The build was failing because More importantly, the per-part
The diff is now one file plus docs and a test. cc @mekilis |
Thanks @alexey-milovidov, this makes sense to me. The sidecar approach did solve the exact per-part tracking case, but I agree the extra file/object per part and protocol churn are too much overhead for this observability column. I’m fine with this direction, thanks once again! |
|
🕵 @groeneai, investigate the failure: https://github.com/ClickHouse/ClickHouse/actions/runs/30681635595/job/91333852497 and provide a fix in a separate PR. If the fix is already in progress, link it here.
Not a regression from this PR — the diff here is one system-table source file that adds a SELECT toStartOfDay(check_start_time) AS day, count() AS n, groupUniqArray(pull_request_number) AS prs
FROM checks
WHERE check_start_time > now() - INTERVAL 30 DAY
AND test_name LIKE '%0250-4e52%' AND test_status IN ('FAIL','ERROR')
GROUP BY day ORDER BY day DESCNote that #102803 tracked this same STID and was closed on 2026-04-15, but it clearly still reproduces. The wider family is tracked by the open #107619, with open fix attempts in #109722 and #102192. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 23/24 (95.83%) · Uncovered code |
|
Thanks - investigated. The Excluded by design. Neither open PR covers it. #102192 does not touch Reproduced deterministically on a fix-containing build - master
So the excluded branch has two faces: silently wrong results on the old analyzer, and the Correction 1: both hits you cited as master predate the fix. Correction 2: #102803 was closed 2026-07-12, by you, not 04-15 - the day after #107924 merged, so as fixed by it. Correct for the paths it covers; this row is the excluded branch. Not reopened, that call is yours. Keyed on the message rather than one STID hash (the family spans 6 STIDs and 8 IN spellings, so a per-STID filter under-reports it): before the merge 266 rows / 202 PRs / 20 true-master / 11.1 per day; after, 77 / 64 / 0 / 3.7. The fix held for trunk; I will send a separate PR under #107619. The exclusion comment raises a real constraint - the external table has to be written during the run, so cloning the source is not enough - so my intended direction is to let the deferred build rebuild the external table when the speculative pass fails silently, keeping the streaming write and transfer limits on the speculative pass. If you would rather the speculative in-place build were skipped entirely for the external-table case, say so and I will do that instead. |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/PRs/108775/2f94b2fff9b5f77279ce379c3a6180a10b2d166d/stress_test_arm_tsan/job.log and provide a fix in a separate PR. If the fix is already in progress, link it here.
No ThreadSanitizer report, no Not a regression from this PR:
SELECT toStartOfDay(check_start_time) AS day, count() AS n, groupUniqArray(pull_request_number) AS prs
FROM checks
WHERE check_start_time > now() - INTERVAL 14 DAY
AND check_name = 'Stress test (arm_tsan)' AND test_status IN ('FAIL','ERROR')
GROUP BY day ORDER BY day DESC
|
|
I investigated. Agreed this is not a regression from this PR, and I can confirm your reading of the artifacts. Two separate things are going on, and only the second is fixable in the harness. The stall is real, and it is server-side. The Why you could not see more than the watchdog. The job never uploaded its artifacts. Every one of the 9 green stress variants on this commit attached 18-19 files, including The harness defect: teardown is unbounded because the timeout flag it passes is the wrong one. Every teardown command passes
The first row reproduces the CI log exactly. The consequence is the So the fix I would send is to pass On the watchdog mislabel, a fix is already in progress: #112269 identifies the server from Breadth. This sub-signature is invisible to CIDB by the obvious keys: over 14 days of stress FAIL/ERROR rows, Session id: cron:clickhouse-premium-slot-24:20260801-100800 |
|
On the separate PR I promised for the I checked #102192 and my #109722 before, but missed #102308. Verified at its live head So opening my own PR would compete with it on the identical hunk with a conflicting design, and would pre-empt the replace-versus-supersede choice you left open in your 2026-07-12 comment there. I have posted the technical analysis on #102308 instead: #102308 (comment). It covers a If you would rather close #102308 as superseded and have only specific pieces carried over on top of #107924, tell me which and I will prepare that PR. My #109722 is still open and redundant now that #107924 merged, so feel free to close it. The |
|
After this change, I do not think the PR makes sense. |
|
Without adding a new file, this can only be made by scanning, or at least, peeking at the columns' data. We should reconsider this approach. The PR is reviewed. Closing. |
|
Thanks for the review and rework. Agreed: without exact per-part metadata the feature is too weak, and adding a file per part is too much overhead. Closing makes sense. |
|
The separate PR is open: #112927 It bounds the I have not gone at the server-side stall itself, which was the alternative I offered above. It is |
Add a
compression_codeccolumn tosystem.parts_columnsso users can inspect the codec reported for each column of each data part.The value is the column's own
CODEC(...)from the table metadata when it has one, and the default compression codec of that data part (persisted per part indefault_compression_codec.txt, and following thedefault_compression_codecsetting or the<compression>configuration) otherwise. Since the codec a part was actually written with is not persisted per column, a part written before anALTER TABLE ... MODIFY COLUMN ... CODECand not yet rewritten by a merge or mutation still holds the previous codec on disk; the column reports the current definition for it.An earlier revision persisted exact per-column codecs in a new
column_compression_codecs.txtfile in every part. That was dropped because it cost one extra file, one more object/PUTper part on object storage, about 100 bytes of metadata in everyMergeTreepart, and a replication protocol version bump. That is too much permanent write-path overhead for an observability column.Closes: #37311
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added a
compression_codeccolumn tosystem.parts_columns, showing each column's declaredCODEC(...)or the part's default compression codec. AfterALTER TABLE ... MODIFY COLUMN ... CODEC, existing parts follow the current column definition until they are rewritten by a merge or mutation.Documentation entry for user-facing changes