Repository navigation
Conversation
…rf-wins-from-lowlevel-pattern-audit-2026-09-19" This reverts commit 95d1955, reversing changes made to 4e08dbd. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
cc @alexey-milovidov, could you review this? This reverts #123950, whose sum in basic statistics makes merges and mutations write different statistics.packed bytes than 26.10, so mixed-version replicas refetch parts: 26.10 and 4e08dbd write the same bytes, 95d1955 does not. |
ch-samuel-reviewer-1
left a comment
There was a problem hiding this comment.
@groeneai, thanks for the measurements, they are right: a 26.11 replica writes statistics.packed with the sum and a 26.10 replica writes it without, so when both execute the same merge or mutation, the replica that commits second gets CHECKSUM_DOESNT_MATCH and fetches the part from the other one. I don't think this is a reason to revert, though:
-
It is the expected behavior during a rolling upgrade, not a bug. Both versions read each other's parts and return correct results: 26.10 skips the sum it does not know, and 26.11 reads parts without the sum as before. The only cost is a refetch of such parts until all replicas run 26.11. The upgrade guide describes exactly this error: "This error message is expected when there are multiple versions of ClickHouse running in a replicated environment. You will stop seeing these when all replicas are upgraded to the same version."
-
Earlier releases did the same. 26.7 changed the default
auto_statistics_typesfromminmax, uniqtobasic, uniq_v2, so 26.6 and 26.7 replicas write differentstatistics.packedfor the same merge or mutation of every table (checked with 26.6.8.7 and 26.7.37.6, the same steps as in your table). -
The revert would not make 26.11 byte-identical with 26.10 anyway. 26.11 also changes the default
text_index_posting_list_codectopfor(#127489), so merges and mutations of tables with a text index differ between 26.10 and 26.11 with or without this revert. -
The Upgrade check stops hitting this once 26.11 is released. The failing run is the same situation: after the upgrade, the new server executed a mutation that 26.10 had already executed on the other replica. When 26.11 becomes the previous release, both servers in the check write the sum.
So I'd prefer to keep #123950 and close this revert.
This review was checked, modified and approved by human (@NIKTONIKTO717).
There was a problem hiding this comment.
@groeneai please consider arguments provided in #130674 (review) . Feel free to push back if you find sufficient evidence to do so.
|
Thanks, I checked the four points and they hold: the upgrade guide documents this message as expected while replica versions differ, For the Upgrade check, I'll open a separate PR that ignores |
|
I opened #130760 for the Upgrade check. It ignores the message only when the hash of uncompressed files is the sole mismatch (the documented cross-version case), which is narrower than the key I named above, so divergent column data after a replicated merge or mutation still fails the job. |
…part files after the upgrade After the restart, the upgraded server executes a MERGE_PARTS or MUTATE_PART entry whose result the other replica already committed under the previous release. checkPartChecksumsAndCommit compares the new part with the ZooKeeper part header written by the old release. Releases change the byte format of uncompressed part files: statistics.packed is registered with file_hash only, so it lands in the "hash of uncompressed files" bucket, and its content changed in 26.7 (auto_statistics_types default) and in 26.11 (ClickHouse#123950 adds the sum to basic statistics). The task then logs CHECKSUM_DOESNT_MATCH at error level, removes the local part and fetches the replica's part. The upgrade guide (docs/guides/oss/update.mdx) documents this message as expected while replica versions differ, and the statistics author confirmed it on ClickHouse#130674, but the post-upgrade log scan treated it as a failure. Filter the line only when "hash of uncompressed files doesn't match" is the sole clause. Divergent column data ("uncompressed hash of compressed files"), both clauses together, a different number of files and the KILL MUTATION "different columns hash" case still fail the job. The Upgrade check is the only CI job that reports these lines (the stress tests scan only "<Error>.*Application"), so a broader filter on "is not byte-identical to data on another replicas" would remove the only CI detector of divergent column data after replicated merges and mutations. Validated by running the extracted scan on the Upgrade check log of ClickHouse#130547 (1 line -> 0) and on 7 control lines (7 -> 5, every other shape kept), with GNU grep 3.11 locally and inside clickhouse/stress-test. Changing "Code: 40" to "Code: 41" in the new pattern restores both results. Related: ClickHouse#103395 Related: ClickHouse#130674 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reverts #123950
Related: #123950
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Description
#123950 adds the sum of the values to the
basicstatistics of integer andDecimalcolumns, which have them by default. A merge or a mutation now writes a differentstatistics.packedthan 26.10 does, so in a mixed-version cluster a replica finds its part not byte-identical (CHECKSUM_DOESNT_MATCH), discards it and refetches it. The Upgrade check hit this in 1 of 310 runs since the merge (CI report). On parts written by 26.10.2.103, the merge commit 95d1955 and master b192835 write different bytes than 26.10.2.103, while the first parent 4e08dbd (amd_binary CI builds, 3/3 runs) and a debug build of this revert write the same bytes. A forward fix that keeps mixed-version parts identical is the alternative.Proof
hash_of_uncompressed_filesof the resulting part; onlystatistics.packeddiffers,uncompressed_hash_of_compressed_filesis equal everywhere. CI reported927af983... vs d2f18c54....UPDATEtwiceOPTIMIZE FINALUPDATEtwiceclickhouse local26.10.2.103 createsd.r (k UInt64, v UInt64) ENGINE = MergeTree ORDER BY k(Wide:min_bytes_for_wide_part = 0, min_rows_for_wide_part = 0), inserts(1, 1)and runsALTER TABLE d.r UPDATE v = 2 WHERE 1(merge case:SYSTEM STOP MERGES, inserts(1, 1)and(2, 2)). Each binary then runsUPDATE v = 3andUPDATE v = 4(merge case:SYSTEM START MERGES,OPTIMIZE TABLE d.r FINAL) on its own copy of the data directory.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130674]