Skip to content

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

Merged
karalabe merged 1 commit into
ethereum:masterfrom
karalabe:snapshots-abort-resume-on-sync
Apr 30, 2021
Merged

core, eth: abort snapshot generation on snap sync and resume later#22777
karalabe merged 1 commit into
ethereum:masterfrom
karalabe:snapshots-abort-resume-on-sync

Conversation

@karalabe
Copy link
Copy Markdown
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
Comment thread core/state/snapshot/snapshot.go Outdated
Copy link
Copy Markdown
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

Comment thread core/rawdb/schema.go Outdated
Comment thread core/state/snapshot/snapshot.go Outdated
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