Plumb maximum_incremental_snapshot_archives_to_retain
(#19640)
This commit is contained in:
@ -54,6 +54,7 @@ impl SnapshotPackagerService {
|
||||
snapshot_utils::archive_snapshot_package(
|
||||
&snapshot_package,
|
||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||
snapshot_config.maximum_incremental_snapshot_archives_to_retain,
|
||||
)
|
||||
.expect("failed to archive snapshot package");
|
||||
|
||||
@ -190,6 +191,7 @@ mod tests {
|
||||
snapshot_utils::archive_snapshot_package(
|
||||
&snapshot_package,
|
||||
snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
|
||||
snapshot_utils::DEFAULT_MAX_INCREMENTAL_SNAPSHOT_ARCHIVES_TO_RETAIN,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
@ -1238,6 +1238,7 @@ fn new_banks_from_ledger(
|
||||
&snapshot_config.snapshot_archives_dir,
|
||||
snapshot_config.archive_format,
|
||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||
snapshot_config.maximum_incremental_snapshot_archives_to_retain,
|
||||
)
|
||||
.unwrap_or_else(|err| {
|
||||
error!("Unable to create snapshot: {}", err);
|
||||
|
@ -299,7 +299,8 @@ mod tests {
|
||||
let snapshot_package = SnapshotPackage::from(accounts_package);
|
||||
snapshot_utils::archive_snapshot_package(
|
||||
&snapshot_package,
|
||||
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
|
||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||
snapshot_config.maximum_incremental_snapshot_archives_to_retain,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
@ -387,7 +388,7 @@ mod tests {
|
||||
let saved_slot = 4;
|
||||
let mut saved_archive_path = None;
|
||||
|
||||
for forks in 0..snapshot_utils::MAX_BANK_SNAPSHOTS + 2 {
|
||||
for forks in 0..snapshot_utils::MAX_BANK_SNAPSHOTS_TO_RETAIN + 2 {
|
||||
let bank = Bank::new_from_parent(
|
||||
&bank_forks[forks as u64],
|
||||
&Pubkey::default(),
|
||||
@ -483,7 +484,7 @@ mod tests {
|
||||
assert!(bank_snapshots
|
||||
.into_iter()
|
||||
.map(|path| path.slot)
|
||||
.eq(3..=snapshot_utils::MAX_BANK_SNAPSHOTS as u64 + 2));
|
||||
.eq(3..=snapshot_utils::MAX_BANK_SNAPSHOTS_TO_RETAIN as u64 + 2));
|
||||
|
||||
// Create a SnapshotPackagerService to create tarballs from all the pending
|
||||
// SnapshotPackage's on the channel. By the time this service starts, we have already
|
||||
@ -776,6 +777,7 @@ mod tests {
|
||||
snapshot_config.archive_format,
|
||||
snapshot_config.snapshot_version,
|
||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||
snapshot_config.maximum_incremental_snapshot_archives_to_retain,
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
@ -812,6 +814,7 @@ mod tests {
|
||||
snapshot_config.archive_format,
|
||||
snapshot_config.snapshot_version,
|
||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||
snapshot_config.maximum_incremental_snapshot_archives_to_retain,
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user