Skip to content

Commit

Permalink
Revert "Rename maximum_full_snapshot_archives_to_retain (solana-labs#…
Browse files Browse the repository at this point in the history
…19610)"

This reverts commit 3d94d2e.
  • Loading branch information
frits-metalogix authored Nov 24, 2021
1 parent d6eb485 commit 5887d91
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 23 deletions.
2 changes: 1 addition & 1 deletion core/src/accounts_hash_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ mod tests {
bank_snapshots_dir: PathBuf::default(),
archive_format: ArchiveFormat::Tar,
snapshot_version: SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain: usize::MAX,
maximum_snapshots_to_retain: usize::MAX,
};
for i in 0..MAX_SNAPSHOT_HASHES + 1 {
let accounts_package = AccountsPackage {
Expand Down
3 changes: 1 addition & 2 deletions core/src/test_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,7 @@ impl TestValidator {
snapshot_archives_dir: ledger_path.to_path_buf(),
archive_format: ArchiveFormat::Tar,
snapshot_version: SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain:
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
}),
enforce_ulimit_nofile: false,
warp_slot: config.warp_slot,
Expand Down
4 changes: 2 additions & 2 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ impl Validator {
snapshot_hash,
&exit,
&cluster_info,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.maximum_snapshots_to_retain,
);
(
Some(snapshot_packager_service),
Expand Down Expand Up @@ -1237,7 +1237,7 @@ fn new_banks_from_ledger(
None,
&snapshot_config.snapshot_archives_dir,
snapshot_config.archive_format,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.maximum_snapshots_to_retain,
)
.unwrap_or_else(|err| {
error!("Unable to create snapshot: {}", err);
Expand Down
9 changes: 4 additions & 5 deletions core/tests/snapshots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ mod tests {
bank_snapshots_dir: bank_snapshots_dir.path().to_path_buf(),
archive_format: ArchiveFormat::TarBzip2,
snapshot_version,
maximum_full_snapshot_archives_to_retain:
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
};
bank_forks.set_snapshot_config(Some(snapshot_config.clone()));
SnapshotTestConfig {
Expand Down Expand Up @@ -772,7 +771,7 @@ mod tests {
bank.get_snapshot_storages(None),
snapshot_config.archive_format,
snapshot_config.snapshot_version,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.maximum_snapshots_to_retain,
)?;

Ok(())
Expand Down Expand Up @@ -808,7 +807,7 @@ mod tests {
storages,
snapshot_config.archive_format,
snapshot_config.snapshot_version,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.maximum_snapshots_to_retain,
)?;

Ok(())
Expand Down Expand Up @@ -925,7 +924,7 @@ mod tests {
&cluster_info,
snapshot_test_config
.snapshot_config
.maximum_full_snapshot_archives_to_retain,
.maximum_snapshots_to_retain,
);

let accounts_hash_verifier = AccountsHashVerifier::new(
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ fn load_bank_forks(
bank_snapshots_dir,
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
})
};
let account_paths = if let Some(account_paths) = arg_matches.value_of("account_paths") {
Expand Down
3 changes: 1 addition & 2 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3534,8 +3534,7 @@ fn setup_snapshot_validator_config(
bank_snapshots_dir: bank_snapshots_dir.path().to_path_buf(),
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain:
snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
};

// Create the account paths
Expand Down
4 changes: 2 additions & 2 deletions replica-node/src/replica_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn initialize_from_snapshot(
&replica_config.snapshot_archives_dir,
replica_config.snapshot_info,
false,
snapshot_config.maximum_full_snapshot_archives_to_retain,
snapshot_config.maximum_snapshots_to_retain,
&mut None,
)
.unwrap();
Expand Down Expand Up @@ -268,7 +268,7 @@ impl ReplicaNode {
bank_snapshots_dir: replica_config.bank_snapshots_dir.clone(),
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain:
maximum_snapshots_to_retain:
snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
};

Expand Down
3 changes: 1 addition & 2 deletions replica-node/tests/local_replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ fn setup_snapshot_validator_config(
bank_snapshots_dir: bank_snapshots_dir.path().to_path_buf(),
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: snapshot_utils::SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain:
snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
};

// Create the account paths
Expand Down
3 changes: 1 addition & 2 deletions rpc/src/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,7 @@ mod tests {
bank_snapshots_dir: PathBuf::from("/"),
archive_format: ArchiveFormat::TarBzip2,
snapshot_version: SnapshotVersion::default(),
maximum_full_snapshot_archives_to_retain:
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
maximum_snapshots_to_retain: DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
}),
bank_forks,
RpcHealth::stub(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/snapshot_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ pub struct SnapshotConfig {
pub snapshot_version: SnapshotVersion,

/// Maximum number of full snapshot archives to retain
pub maximum_full_snapshot_archives_to_retain: usize,
pub maximum_snapshots_to_retain: usize,
}
6 changes: 3 additions & 3 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ fn rpc_bootstrap(
let maximum_snapshots_to_retain = if let Some(snapshot_config) =
validator_config.snapshot_config.as_ref()
{
snapshot_config.maximum_full_snapshot_archives_to_retain
snapshot_config.maximum_snapshots_to_retain
} else {
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN
};
Expand Down Expand Up @@ -2627,7 +2627,7 @@ pub fn main() {

let snapshot_interval_slots = value_t_or_exit!(matches, "snapshot_interval_slots", u64);
let maximum_local_snapshot_age = value_t_or_exit!(matches, "maximum_local_snapshot_age", u64);
let maximum_full_snapshot_archives_to_retain =
let maximum_snapshots_to_retain =
value_t_or_exit!(matches, "maximum_snapshots_to_retain", usize);
let minimal_snapshot_download_speed =
value_t_or_exit!(matches, "minimal_snapshot_download_speed", f32);
Expand Down Expand Up @@ -2679,7 +2679,7 @@ pub fn main() {
snapshot_archives_dir: snapshot_archives_dir.clone(),
archive_format,
snapshot_version,
maximum_full_snapshot_archives_to_retain,
maximum_snapshots_to_retain,
});

validator_config.accounts_hash_interval_slots =
Expand Down

0 comments on commit 5887d91

Please sign in to comment.