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

core, eth: abort snapshot generation on snap sync and resume later #22777

Merged
merged 1 commit into from
Apr 30, 2021

Conversation

karalabe
Copy link
Member

The new snap sync algo reuses the snapshot namespace instead of wiping and regenerating at the end. This means we need to disable snapshots from being used during sync. This disabling needs to survive restarts too.

A previous attempt tried to just nuke the journal, but that didn't really do anything as the existing snapshot was already live and used and a restart just considered everything missing and started a regeneration cycle from scratch, deleting the valuable partial data.

This PR solves it by adding a new marker to the database to track disabled snapshots, and on top it also aborts any active generation on demand and marks all existing layers stale so any accidental live use gets gracefully stopped too.

@karalabe karalabe added this to the 1.10.3 milestone Apr 29, 2021
@karalabe karalabe force-pushed the snapshots-abort-resume-on-sync branch from d2e314a to 26f1245 Compare April 29, 2021 15:19
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

nitpicks, otherwise lgtm.

But let's do a few sync before merging it

core/rawdb/schema.go Show resolved Hide resolved
core/state/snapshot/snapshot.go Show resolved Hide resolved
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.

3 participants