Errors that can happen in add_bank_snapshot()
The different archive formats used for snapshots
Errors that can happen in archive_snapshot_package()
Bank snapshots traditionally had their accounts hash calculated prior to serialization. Since
the hash calculation takes a long time, an optimization has been put in to offload the accounts
hash calculation. The bank serialization format has not changed, so we need another way to
identify if a bank snapshot contains the calculated accounts hash or not.
Errors that can happen in get_snapshot_accounts_hardlink_dir()
Errors that can happen in hard_link_storages_to_snapshot()
When constructing a bank a snapshot, traditionally the snapshot was from a snapshot archive. Now,
the snapshot can be from a snapshot directory, or from a snapshot archive. This is the flag to
indicate which.
allow tests to specify what happened to the serialized format
Errors that can happen in verify_epoch_stakes()
Errors that can happen in verify_slot_deltas()
Build the full snapshot archive path from its components: the snapshot archives directory, the
snapshot slot, the accounts hash, and the archive format.
Build the incremental snapshot archive path from its components: the snapshot archives
directory, the snapshot base slot, the snapshot slot, the accounts hash, and the archive
format.
The account snapshot directories under <account_path>/snapshot/ contain account files hardlinked
from <account_path>/run taken at snapshot time. They are referenced by the symlinks from the
bank snapshot dir snapshot//accounts_hardlinks/. We observed that sometimes the bank snapshot dir
could be deleted but the account snapshot directories were left behind, possibly by some manual operations
or some legacy code not using the symlinks to clean up the account snapshot hardlink directories.
This function cleans up any account snapshot directories that are no longer referenced by the bank
snapshot dirs, to ensure proper snapshot operations.
Constructs the path to the bank snapshot directory for slot
within bank_snapshots_dir
Get the bank snapshots in a directory
Get the bank snapshots in a directory
Get the bank snapshots in a directory
Get a list of the full snapshot archives from a directory
Get the bank snapshot with the highest slot in a directory
Get the bank snapshot with the highest slot in a directory
Get the bank snapshot with the highest slot in a directory
Get the path (and metadata) for the full snapshot archive with the highest slot in a directory
Get the highest slot of the full snapshot archives in a directory
Get the path for the incremental snapshot archive with the highest slot, for a given full
snapshot slot, in a directory
Get the highest slot of the incremental snapshot archives in a directory, for a given full
snapshot slot
Gets the highest, loadable, bank snapshot
Get a list of the incremental snapshot archives from a directory
Returns the file name of the bank snapshot for slot
Hard-link the files from accounts/ to snapshot/<bank_slot>/accounts/
This keeps the appendvec files alive and with the bank snapshot. The slot and id
in the file names are also updated in case its file is a recycled one with inconsistent slot
and id.
Get the &str
from a &Path
Purges all bank snapshots
Remove the bank snapshot at this path
Purges bank snapshots that are older than slot
Purges incomplete bank snapshots
Purges bank snapshots, retaining the newest num_bank_snapshots_to_retain
At startup, purge old (i.e. unusable) bank snapshots
Performs the common tasks when deserializing a snapshot
If the validator halts in the middle of archive_snapshot_package()
, the temporary staging
directory won’t be cleaned up. Call this function to clean them up.
Serializes and archives a snapshot package
Unarchives the given full and incremental snapshot archives, as long as they are compatible.
Writes the full snapshot slot file into the bank snapshot dir