* purge_old_snapshot_archives is changed to take an extra argument 'maximum_snapshots_to_retain' to control the max number of latest snapshot archives to retain. Note the oldest snapshot is always retained as before and is not subjected to this new options. * The validator and ledger-tool executables are modified with a CLI argument --maximum-snapshots-to-retain. And the options are propagated down the call chains. Their corresponding shell scripts were changed accordingly. * SnapshotConfig is modified to have an extra field for the maximum_snapshots_to_retain * Unit tests are developed to cover purge_old_snapshot_archives
This commit is contained in:
@ -1684,6 +1684,7 @@ fn test_snapshot_download() {
|
||||
&validator_archive_path,
|
||||
archive_snapshot_hash,
|
||||
false,
|
||||
snapshot_utils::DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@ -3134,6 +3135,7 @@ fn setup_snapshot_validator_config(
|
||||
snapshot_path: PathBuf::from(snapshot_dir.path()),
|
||||
archive_format: ArchiveFormat::TarBzip2,
|
||||
snapshot_version: snapshot_utils::SnapshotVersion::default(),
|
||||
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_SNAPSHOTS_TO_RETAIN,
|
||||
};
|
||||
|
||||
// Create the account paths
|
||||
|
Reference in New Issue
Block a user