* 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:
@@ -626,6 +626,7 @@ impl Validator {
|
||||
snapshot_hash,
|
||||
&exit,
|
||||
&cluster_info,
|
||||
snapshot_config.maximum_snapshots_to_retain,
|
||||
);
|
||||
(
|
||||
Some(snapshot_packager_service),
|
||||
@@ -1166,6 +1167,7 @@ fn new_banks_from_ledger(
|
||||
&snapshot_config.snapshot_package_output_path,
|
||||
snapshot_config.archive_format,
|
||||
Some(&bank_forks.root_bank().get_thread_pool()),
|
||||
snapshot_config.maximum_snapshots_to_retain,
|
||||
)
|
||||
.unwrap_or_else(|err| {
|
||||
error!("Unable to create snapshot: {}", err);
|
||||
|
Reference in New Issue
Block a user