v2.3: AppendVec::new_from_storage() does sanitization if len and capacity do not match (backport of #6803)#6838
Merged
brooksprumo merged 1 commit intov2.3from Jul 3, 2025
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2.3 #6838 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 850 850
Lines 379636 379646 +10
=========================================
- Hits 314650 314587 -63
- Misses 64986 65059 +73 🚀 New features to boost your workflow:
|
t-nelson
approved these changes
Jul 3, 2025
HaoranYi
approved these changes
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Minimized snapshots created with older versions of ledger-tool can have storages with a capacity (file size) larger than their len (number of bytes) (see #6797 for an example). This is no longer an issue in master, as
shrink(which is used to write the new, minimized storages) now sets the correct file size for new storages.After merging #6552, it was no longer possible to open those snapshots with storages that have mismatched capacity and len.
Summary of Changes
At startup when rebuilding storages, if the capacity and len mismatch, fall back to the old/slow impl that does the full sanitization of the storage file.
Fixes #6797
Justification to Backport
Since #6552 was backported to v2.3, the bug also exists on v2.3 (and should be fixed there too).
This is an automatic backport of pull request #6803 done by [Mergify](https://mergify.com).