Skip to content

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
mergify/bp/v2.3/pr-6803
Jul 3, 2025
Merged

v2.3: AppendVec::new_from_storage() does sanitization if len and capacity do not match (backport of #6803)#6838
brooksprumo merged 1 commit intov2.3from
mergify/bp/v2.3/pr-6803

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Jul 3, 2025

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).

@mergify mergify Bot requested a review from a team as a code owner July 3, 2025 17:58
@brooksprumo brooksprumo requested review from HaoranYi and roryharr July 3, 2025 18:00
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 82.8%. Comparing base (292b33f) to head (6d0d07c).
Report is 1 commits behind head on v2.3.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brooksprumo brooksprumo merged commit 04e3b67 into v2.3 Jul 3, 2025
46 checks passed
@brooksprumo brooksprumo deleted the mergify/bp/v2.3/pr-6803 branch July 3, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants