Repository navigation
Upgrade check: ignore the expected checksum mismatch of uncompressed part files after the upgrade - #130760
Conversation
…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]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (1 finding).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-11:20261111-110300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261111-105400 |
|
Workflow [PR], commit [d6ed09b] Summary: ✅ AI ReviewSummaryPR #130760 suppresses a specific replicated merge/mutation checksum error in the upgrade log scan to tolerate cross-version changes to Findings
Tests
Final Verdict |
| | grep -av -e "SystemLogQueue.*Queue had been full" \ | ||
| | grep -av -e "TraceCollector.*CANNOT_READ_FROM_FILE_DESCRIPTOR" \ | ||
| | grep -av -e "while loading statistics.*ILLEGAL_STATISTICS" \ | ||
| | grep -av -e "(\(Merge\|Mutate\)FromLogEntryTask): Code: 40\. DB::Exception: Checksums of parts don't match: hash of uncompressed files doesn't match ([0-9a-f]* vs [0-9a-f]*)\. (CHECKSUM_DOESNT_MATCH) (version .*)\. Data after \(merge\|mutation\) is not byte-identical to data on another replicas\." \ |
There was a problem hiding this comment.
The parent part's hash of uncompressed files also covers projection data, so this clause does not establish that only metadata differs. MergedBlockOutputStream::finalizePartAsync adds each <projection>.proj using the three-argument addFile, with the projection's entire getTotalChecksumUInt128 as its hash (source). That entry has is_compressed = false; rebuilt projections in MutateTask use the same representation.
For two parts with identical main-table data and file counts but different projected column values, only the parent's hash_of_uncompressed_files differs; its uncompressed_hash_of_compressed_files remains equal. MinimalisticDataPartChecksums::checkEqualImpl therefore emits exactly the sole-clause message removed here. The upgrade check would silently accept a projection-data regression, despite the stated requirement to keep detecting divergent column data. This also applies across versions, independently of the acknowledged same-version metadata tradeoff.
Please verify that differences are confined to approved metadata before suppressing this error, or preserve a separate projection-data comparison. Validate with equal main-table data and differing projection data; string-only controls cannot distinguish this case from the expected statistics mismatch.
There was a problem hiding this comment.
Agreed: the line cannot separate projection data from the expected metadata change, so d6ed09b states that divergent projection data is hidden too instead of claiming the job still detects it.
…data MergedBlockOutputStream::finalizePartAsync and MutateTask register each projection in the parent part's checksums as `<name>.proj` with the two-argument addFile, so the entry has is_compressed = false and its hash is getTotalChecksumUInt128 of the projection part. computeTotalChecksums then puts it into the parent's "hash of uncompressed files", next to statistics.packed. A divergence of projection rows therefore produces the same sole-clause message as the expected statistics format change, and the line alone cannot tell them apart. The comment claimed that divergent column data still fails the job; that holds only for the part's own columns. Say so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
alexey-milovidov
left a comment
There was a problem hiding this comment.
Yes, this could be too wide, but I see no other way.
Related: #103395 (comment)
Related: #130674
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Upgrade check (amd_release)failsError message in clickhouse-server.logon unrelated PRs with one line, e.g. on #130547 (report):After the restart, the upgraded server redoes a merge or mutation that the other replica committed under the previous release and compares the result with the part header in ZooKeeper. Uncompressed part files change format between releases (
statistics.packedchanged in 26.7 with theauto_statistics_typesdefault and in 26.11 with #123950), so the hash of uncompressed files differs and the replica fetches the part. The upgrade guide (docs/guides/oss/update.mdx) documents this message as expected while replica versions differ, and the statistics author confirmed it in #130674.The log scan now ignores the line only when the hash of uncompressed files is the sole mismatch. Divergent data of the part's own columns (
uncompressed hash of compressed files), a different number of files and the KILL MUTATIONdifferent columns hashcase still fail the job, since it is the only CI check that reports them. Hidden too, and self-healed by the same fetch: the same line from a same-version merge, and divergent projection data, because each projection is one uncompressed<name>.projentry of the parent part's checksums.Validated by running the extracted scan on the #130547 log (1 line -> 0) and on 7 control lines (7 -> 5, every other shape kept), locally and inside
clickhouse/stress-test; breaking the new pattern restores both results. No test is committed, because this is test infrastructure.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/130760]
Version info
26.11.1.2031-master(included in26.11and later)