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

consortium-v2/snapshot: prune old, unused snapshots #467

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Francesco4203
Copy link
Collaborator

@Francesco4203 Francesco4203 commented Jun 12, 2024

Only some most recent consortium snapshots are used, so this PR is to prune some old, unused snapshots.
The pruning can be done in two ways:

  • Periodically: every day, automatically prune all the snapshots from 6 to 7 days ago
  • Manually: command to prune all the snapshots, keeping only some most current snapshots

Example command to prune all snapshots, keeping 1000 latest ones:

./build/bin/ronin db prune-consortium-snapshot --snapshot.keep-after-pruning=1000 --datadir="path-to-datadir"

@huyngopt1994
Copy link
Collaborator

@Francesco4203 Could u give some description related to its usage?

@Francesco4203
Copy link
Collaborator Author

@huyngopt1994 I have updated the description

consensus/consortium/v2/snapshot.go Outdated Show resolved Hide resolved
cmd/utils/flags.go Outdated Show resolved Hide resolved
consensus/consortium/v2/snapshot.go Outdated Show resolved Hide resolved
@Francesco4203 Francesco4203 changed the title SnapshotPruning: prune old, unused snapshots consortium/v2/snapshot: prune old, unused snapshots Jul 8, 2024
@Francesco4203 Francesco4203 changed the title consortium/v2/snapshot: prune old, unused snapshots consortium-v2/snapshot: prune old, unused snapshots Jul 8, 2024
consensus/consortium/v2/consortium.go Outdated Show resolved Hide resolved
consensus/consortium/v2/consortium.go Outdated Show resolved Hide resolved
pruneSnapshot: delete the nSnapshotsPrune oldest snapshots, keep the latestSnapshotsKeep snapshots
pruneSnapshotPeriodically: prune the snapshots at the start of each pruningPeriod
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