-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
SnapshotPackagerService purges old bank snapshots #31511
SnapshotPackagerService purges old bank snapshots #31511
Conversation
b169a7a
to
afd4e00
Compare
afd4e00
to
e8db8ac
Compare
Codecov Report
@@ Coverage Diff @@
## master #31511 +/- ##
===========================================
+ Coverage 0 81.4% +81.4%
===========================================
Files 0 731 +731
Lines 0 205114 +205114
===========================================
+ Hits 0 167019 +167019
- Misses 0 38095 +38095 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - logic seems sound that we don't want to keep the snapshots (hardlinks) around. They are no longer necessary after we archive (keeping current).
Taking it a step further, what reason is there for having more than the most reason snapshot?
We will want to keep around the most recent bank snapshot so that we can boot from it (eventually). Beyond that, there's no need. When the bank snapshots were put into temp directories, they were cleaned up as part of a normal running validator in AccountsBackgroundService when taking a new snapshot (bank, not archive). That's not really safe now, since the bank snapshots for archival are not in temp dirs... We're kinda hoping that AHV and SPS run fast enough so that ABS doesn't rug the bank snapshots... That's a future PR to fix up. I'm sure there will be more to learn/fix here as well. |
…lana-labs#31511)" (solana-labs#31524)" This reverts commit 775639c.
…lana-labs#31511)" (solana-labs#31524)" This reverts commit 775639c.
…lana-labs#31511)" (solana-labs#31524)" This reverts commit 775639c.
Problem
We retain more bank snapshots than we need, longer than we need.
Bank snapshots are currently used for one thing: creating a snapshot archive. And currently in development, we'll also use bank snapshots to speed up restart by booting from a bank snapshot instead of a snapshot archive. In any case, an observation is that once a snapshot has been archived, all bank snapshots older are no longer useful.
(We want to keep around the bank snapshot that was just archived for the fast boot case mentioned above.)
Also, bank snapshots contain hard-links to account storage files (for fast boot). We should free those up as fast as possible, since they can artificially take up space if the accounts are stored in a RAM disk.
Note that we still have an outstanding problem to solve: What about bank snapshots that are not archived? This happens for accounts hash verifier requests, and if a node has disabled snapshots (which still must produce bank snapshots for AHV, but not snapshot archives). I'll be working on that separately from this PR.
Summary of Changes
SnapshotPackagerService will purge bank snapshots older than the one that was just archived.