Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves 0 for write_version in geyser when restoring from a snapshot #979

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

brooksprumo
Copy link

@brooksprumo brooksprumo commented Apr 22, 2024

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

pub fn set_meta(&mut self, meta: &'storage StoredMeta) {
match self {
Self::AppendVec(av) => av.set_meta(meta),
// Hot account does not support this API as it does not
// use the same in-memory layout as StoredMeta.
Self::Hot(_) => unreachable!(),
}
}

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 this 0 literal inside accountinfo_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 to set_meta().

Summary of Changes

Moves where 0 is set for write version.

This PR is effectively a combination of #721 and #702.

@brooksprumo brooksprumo self-assigned this Apr 22, 2024
@brooksprumo brooksprumo marked this pull request as ready for review April 22, 2024 23:32
Copy link

@jeffwashington jeffwashington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@brooksprumo brooksprumo merged commit 35bcf74 into anza-xyz:master Apr 29, 2024
38 checks passed
@brooksprumo brooksprumo deleted the set-meta/geyser2 branch April 29, 2024 15:15
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.

2 participants