Repository navigation
Handle old VersionInfo metadata format gracefully - #103031
Conversation
Old format metadata files (before `storing_version` was introduced) have
`creation_tid:` immediately after `version: 1`, which caused `assertString`
to throw a parse exception when loading parts on upgraded instances.
Detect old format by checking for `creation_tid:` at the position where
`storing_version:` is expected. `checkString` is safe here because the
first character differs ('c' vs 's'), so it never partially consumes the
buffer on a new-format file. Old-format parts are converted to
non-transactional to avoid the failure.
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
Workflow [PR], commit [ed3ff63] Summary: ✅ AI ReviewSummaryThis PR adds a fallback in PR Metadata
Findings❌ Blockers
Tests
ClickHouse Rules
Final Verdict
|
| /// after the version header. Convert such metadata to non-transactional instead of throwing a parse exception. | ||
| /// `checkString` is safe here because the first character differs ('c' vs 's'), so it never partially consumes. | ||
| if (checkString(CREATION_TID_STR, buf)) | ||
| { |
There was a problem hiding this comment.
This fallback drops all legacy metadata fields after detecting old layout and unconditionally marks the part as non-transactional (creation_tid = NonTransactionalTID, removal_tid = EmptyTID, etc.).
That can silently change semantics for old-format files that still contain meaningful creation_tid / creation_csn / removal_tid / removal_csn values (e.g. rollback/remove state), potentially making an actually removed/rolled-back part look visible.
Please parse the legacy layout instead of replacing it with defaults: keep storing_version = 0 for old files, then read the remaining legacy fields from the buffer (creation_tid, creation_csn, removal_tid, removal_csn) and assign them as-is.
There was a problem hiding this comment.
We don't need to make it compatible, as it is an experimental feature. We just need to handle it without failure
LLVM Coverage Report
Changed lines: 53.85% (7/13) | lost baseline coverage: 1 line(s) · Uncovered code |
Old format metadata files (before
storing_versionwas introduced) havecreation_tid:immediately afterversion: 1, which causedassertStringto throw a parse exception when loading parts on upgraded instances.Detect old format by checking for
creation_tid:at the position wherestoring_version:is expected.checkStringis safe here because the first character differs ('c' vs 's'), so it never partially consumes the buffer on a new-format file. Old-format parts are converted to non-transactional to avoid failure.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.4.1.1099