Repository navigation
Remove use_compact_format_in_distributed_parts_names, always use compact format - #120186
Conversation
|
Workflow [PR], commit [19231f1] Summary: ✅
AI ReviewSummaryThis PR removes the legacy async Final Verdict✅ No new findings on the current head. LLVM Coverage ReportMeasured on commit 19231f1.
Changed lines: Changed C/C++ lines covered: 155/161 (96.27%) · Uncovered code |
42ffee7 to
c93a46f
Compare
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes26 object files changed (-13.48 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units113 translation units recompiled, 1168 s compile time in total, 113 of them have a recent master baseline. |
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
alexey-milovidov
left a comment
There was a problem hiding this comment.
Love this change! LGTM.
…distributed-parts-names # Conflicts: # src/Core/SettingsChangesHistory.cpp
A subdirectory of the async `INSERT` spool whose name is not one `DistributedSink` writes is renamed to `unrecognized_<hash>` on start and gets no `DistributedAsyncInsertDirectoryQueue`, so it is absent from `cluster_nodes_data` and from everything derived from it, including the cleanup done by `TRUNCATE TABLE`. Its files still occupy disk, and there was no way to drop them from SQL. `TRUNCATE TABLE` now sweeps the `unrecognized_*` subdirectories of every disk of the table as well, and the integration test asserts that the spool directory is empty afterwards. The bytes of such a directory are deliberately still left out of `totalBytes`, `system.distribution_queue` and the `bytes_to_delay_insert` / `bytes_to_throw_insert` limits: those files can never be sent, so counting them as backlog would delay or reject inserts forever instead of clearing on its own. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The `Upgrade check` flags every `<Error>` line the server writes, and an upgrade from a version that still wrote the old directory names produces one for every `Distributed` table with a non-empty queue. That is the expected handling of the leftover queue, not a failure of the server, so log it at the warning level, like the message the following starts write for the same directory. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🕵 @groeneai, investigate the failures below and provide a fix in a separate PR; if a fix is already in progress, link it here.
|
|
All three already have an owner, so there is no separate PR from me: two of the fixes are merged and the third is yours.
On that check the message ran from 2026-09-18 12:03 to 2026-09-21 05:35 UTC, 61 rows over PR runs, never on master. 05:35 UTC is the last occurrence anywhere: in the 63
|
…distributed-parts-names # Conflicts: # src/Core/SettingsChangesHistory.cpp
…_replicas` name as a directory queue `DistributedSink::writeToShard` creates one directory per destination, so no writer produces a comma-joined name any more. `isDirectoryQueueName` still split the name on commas and accepted `shard1_replica1,shard1_replica2` as live, letting a stray subdirectory bypass the `unrecognized_*` quarantine and `parseAddresses` replay its files to both replicas on attach. Both now take the whole name as a single destination. The integration test gets the comma-joined case. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…stributed.cpp` The `cpp` style check rejects more than two consecutive empty lines. The blank run appeared after the last review commit and failed https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=120186&sha=24cba6025e663aed756fc67f52419d51527f04a6&name_0=PR&name_1=Style%20check for #120186 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ue name `Cluster::Address::tryParseFullString` used `tryParse<UInt32>` for the shard and replica indices, which also accepts spellings the writer never produces: a leading zero (`shard01_replica1`, `shard1_replica01`, `shard01_all_replicas`) or an explicit sign (`shard+1_replica1`). Since `StorageDistributed::isDirectoryQueueName` takes any successful parse as a live queue, such a directory would escape the `unrecognized_*` quarantine and its `.bin` files would be replayed on attach, breaking the invariant that only writer-produced directory names stay active. Reconstruct the canonical name from the parsed indices and accept the string only if it round-trips exactly. The four alternate spellings are added to `test_invalid_shard_directory_format`. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…distributed-parts-names
|
🕵 Pushed 5315499: the AI-review Major on |
Address review: renaming an unrecognized spool subdirectory to `unrecognized_<hash>` discarded its old name, which for a directory written by a server older than 26.9 is the only record of where its `.bin` files were meant to be sent (`DistributedAsyncInsertHeader` does not store the destination address). A downgrade or a manual recovery could no longer replay them. The old name is now written to a file `original_name` inside the directory before the rename. The directory itself is still renamed to a hash, because the old name may contain a password and the new name is logged and shown. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ng a spool directory The rename to `unrecognized_<hash>`, the write of the `original_name` file, and the removal of such directories on `TRUNCATE TABLE` now run under the directory sync guard (`IDisk::getDirectorySyncGuard`) when `fsync_directories` is set, like the rest of the async-insert spool. `test_invalid_shard_directory_format` runs with both values of the setting; the password in its old-style directory name is unique per run, because `system.text_log` keeps the queries of the earlier run that mention it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🕵 Pushed 2c48227, which addresses the latest AI review:
|
…distributed-parts-names Master moved settings history records into `Settings.cpp` (per-setting records in `DECLARE` / `MAKE_OBSOLETE`). Took master's `SettingsChangesHistory.cpp`, dropped the `DECLARE` of `use_compact_format_in_distributed_parts_names`, and moved its history (21.1 record plus the 26.10 obsolete record) onto its `MAKE_OBSOLETE` entry.
|
🕵 Merged master ( Reds on the previous head are unrelated to this PR:
|
|
Acknowledged. No fix is in progress for |
|
Investigated. Each fill insert of |
Address review: `sipHash128String` is an unkeyed hash, so `unrecognized_<hash>` was a stable verifier of the old directory name, which may contain a password (`user:password@host:port`), and allowed offline brute force of it from the log or the directory listing. The old name is kept in `original_name`, so the visible name does not need to be derived from it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
🕵 Pushed |
Each fill INSERT squashes the numbers_mt stream in the order the SELECT threads deliver its 65409-row blocks and cuts a part once min_insert_block_size_rows (1048449) rows have accumulated, i.e. every 17 blocks, so each INSERT writes 8 parts whose key ranges depend on thread timing. perf.py fills both servers at the same time and merges stay stopped, so the two servers of a comparison measure different 16-part tables for the whole test. Queries #0 and ClickHouse#1 stop at their LIMIT and read a layout-dependent number of rows: on ClickHouse#120186 the new server read 31% more rows for both, and the dashboard gate reported +17.9% and +19.3% as confirmed regressions. Both INSERTs now set min_insert_block_size_rows = 10000000 (above the 8000000 rows of an INSERT) and min_insert_block_size_bytes = 0 (an INSERT is ~350 MB, so the 256 MiB default would still cut it in two). Each INSERT becomes one block, sorted by the key when written, so both servers get the same two intersecting parts, the fixture the test was measured with. A throwIf fill query fails the test if the table does not have exactly 2 active parts. max_insert_threads cannot do this: it only fans the squashed blocks out to the insert sinks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@tavplubix @alexey-milovidov — title/description suggestions: Description (currently
Ignore if intentional. |
…compact format
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The setting
use_compact_format_in_distributed_parts_namesis obsolete now. The non-compact directory format for the asyncINSERTqueue of aDistributedtable has been removed. The setting was 1 by default since version 21.1. Switch to1and let the queue drain before upgrading.Workflow [PR]
Sync PR [sync-upstream/pr/120186]
Version info
26.10.1.1126-master(included in26.10and later)