Moves 0
for write_version in geyser when restoring from a snapshot
#979
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
We are trying to move account storage files away from using mmaps internally. The function
StoredAccountMeta::set_meta()
updates the underlying mmap, which will not be possible once mmaps are removed. (It's also not supported for Tiered Storage at all.)agave/accounts-db/src/account_storage/meta.rs
Lines 174 to 181 in 70c4cb0
The only caller of
set_meta()
is in geyser, when restoring from a snapshot.We use
set_meta
only to set the write version to zero. Instead, we can move this0
literal insideaccountinfo_from_stored_account_meta()
, which is only called when restoring from a snapshot. This ensures we do not change behavior at all, and allows us to remove the call toset_meta()
.Summary of Changes
Moves where
0
is set for write version.This PR is effectively a combination of #721 and #702.