Pass SnapshotConfig to SnapshotPackagerService (#19616)
This commit is contained in:
parent
2c3bdedea3
commit
1828579580
|
@ -1,7 +1,7 @@
|
||||||
use solana_gossip::cluster_info::{ClusterInfo, MAX_SNAPSHOT_HASHES};
|
use solana_gossip::cluster_info::{ClusterInfo, MAX_SNAPSHOT_HASHES};
|
||||||
use solana_runtime::{
|
use solana_runtime::{
|
||||||
snapshot_archive_info::SnapshotArchiveInfoGetter, snapshot_package::PendingSnapshotPackage,
|
snapshot_archive_info::SnapshotArchiveInfoGetter, snapshot_config::SnapshotConfig,
|
||||||
snapshot_utils,
|
snapshot_package::PendingSnapshotPackage, snapshot_utils,
|
||||||
};
|
};
|
||||||
use solana_sdk::{clock::Slot, hash::Hash};
|
use solana_sdk::{clock::Slot, hash::Hash};
|
||||||
use std::{
|
use std::{
|
||||||
|
@ -23,7 +23,7 @@ impl SnapshotPackagerService {
|
||||||
starting_snapshot_hash: Option<(Slot, Hash)>,
|
starting_snapshot_hash: Option<(Slot, Hash)>,
|
||||||
exit: &Arc<AtomicBool>,
|
exit: &Arc<AtomicBool>,
|
||||||
cluster_info: &Arc<ClusterInfo>,
|
cluster_info: &Arc<ClusterInfo>,
|
||||||
maximum_snapshots_to_retain: usize,
|
snapshot_config: SnapshotConfig,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let exit = exit.clone();
|
let exit = exit.clone();
|
||||||
let cluster_info = cluster_info.clone();
|
let cluster_info = cluster_info.clone();
|
||||||
|
@ -53,7 +53,7 @@ impl SnapshotPackagerService {
|
||||||
// last_full_snapshot_slot that requires this archive call to succeed.
|
// last_full_snapshot_slot that requires this archive call to succeed.
|
||||||
snapshot_utils::archive_snapshot_package(
|
snapshot_utils::archive_snapshot_package(
|
||||||
&snapshot_package,
|
&snapshot_package,
|
||||||
maximum_snapshots_to_retain,
|
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
||||||
)
|
)
|
||||||
.expect("failed to archive snapshot package");
|
.expect("failed to archive snapshot package");
|
||||||
|
|
||||||
|
|
|
@ -651,7 +651,7 @@ impl Validator {
|
||||||
snapshot_hash,
|
snapshot_hash,
|
||||||
&exit,
|
&exit,
|
||||||
&cluster_info,
|
&cluster_info,
|
||||||
snapshot_config.maximum_full_snapshot_archives_to_retain,
|
snapshot_config.clone(),
|
||||||
);
|
);
|
||||||
(
|
(
|
||||||
Some(snapshot_packager_service),
|
Some(snapshot_packager_service),
|
||||||
|
|
|
@ -505,7 +505,7 @@ mod tests {
|
||||||
None,
|
None,
|
||||||
&exit,
|
&exit,
|
||||||
&cluster_info,
|
&cluster_info,
|
||||||
DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN,
|
snapshot_config.clone(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let _package_receiver = std::thread::Builder::new()
|
let _package_receiver = std::thread::Builder::new()
|
||||||
|
@ -926,9 +926,7 @@ mod tests {
|
||||||
None,
|
None,
|
||||||
&exit,
|
&exit,
|
||||||
&cluster_info,
|
&cluster_info,
|
||||||
snapshot_test_config
|
snapshot_test_config.snapshot_config.clone(),
|
||||||
.snapshot_config
|
|
||||||
.maximum_full_snapshot_archives_to_retain,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let accounts_hash_verifier = AccountsHashVerifier::new(
|
let accounts_hash_verifier = AccountsHashVerifier::new(
|
||||||
|
|
Loading…
Reference in New Issue