Removes MAX_BANK_SNAPSHOTS_TO_RETAIN constant (#31827)
This commit is contained in:
parent
9d6c921b5f
commit
8a3f446db0
|
@ -31,7 +31,6 @@ use {
|
||||||
snapshot_utils::{
|
snapshot_utils::{
|
||||||
self, ArchiveFormat,
|
self, ArchiveFormat,
|
||||||
SnapshotVersion::{self, V1_2_0},
|
SnapshotVersion::{self, V1_2_0},
|
||||||
MAX_BANK_SNAPSHOTS_TO_RETAIN,
|
|
||||||
},
|
},
|
||||||
status_cache::MAX_CACHE_ENTRIES,
|
status_cache::MAX_CACHE_ENTRIES,
|
||||||
},
|
},
|
||||||
|
@ -329,6 +328,7 @@ fn test_concurrent_snapshot_packaging(
|
||||||
cluster_type: ClusterType,
|
cluster_type: ClusterType,
|
||||||
) {
|
) {
|
||||||
solana_logger::setup();
|
solana_logger::setup();
|
||||||
|
const MAX_BANK_SNAPSHOTS_TO_RETAIN: usize = 8;
|
||||||
|
|
||||||
// Set up snapshotting config
|
// Set up snapshotting config
|
||||||
let mut snapshot_test_config =
|
let mut snapshot_test_config =
|
||||||
|
@ -373,7 +373,7 @@ fn test_concurrent_snapshot_packaging(
|
||||||
let saved_slot = 4;
|
let saved_slot = 4;
|
||||||
let mut saved_archive_path = None;
|
let mut saved_archive_path = None;
|
||||||
|
|
||||||
for forks in 0..snapshot_utils::MAX_BANK_SNAPSHOTS_TO_RETAIN + 2 {
|
for forks in 0..MAX_BANK_SNAPSHOTS_TO_RETAIN + 2 {
|
||||||
let bank = Bank::new_from_parent(
|
let bank = Bank::new_from_parent(
|
||||||
&bank_forks[forks as u64],
|
&bank_forks[forks as u64],
|
||||||
&Pubkey::default(),
|
&Pubkey::default(),
|
||||||
|
@ -484,7 +484,7 @@ fn test_concurrent_snapshot_packaging(
|
||||||
assert!(bank_snapshots
|
assert!(bank_snapshots
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|path| path.slot)
|
.map(|path| path.slot)
|
||||||
.eq(3..=snapshot_utils::MAX_BANK_SNAPSHOTS_TO_RETAIN as u64 + 2));
|
.eq(3..=MAX_BANK_SNAPSHOTS_TO_RETAIN as u64 + 2));
|
||||||
|
|
||||||
// Create a SnapshotPackagerService to create tarballs from all the pending
|
// Create a SnapshotPackagerService to create tarballs from all the pending
|
||||||
// SnapshotPackage's on the channel. By the time this service starts, we have already
|
// SnapshotPackage's on the channel. By the time this service starts, we have already
|
||||||
|
|
|
@ -86,8 +86,6 @@ const MAX_SNAPSHOT_VERSION_FILE_SIZE: u64 = 8; // byte
|
||||||
const VERSION_STRING_V1_2_0: &str = "1.2.0";
|
const VERSION_STRING_V1_2_0: &str = "1.2.0";
|
||||||
pub const TMP_SNAPSHOT_ARCHIVE_PREFIX: &str = "tmp-snapshot-archive-";
|
pub const TMP_SNAPSHOT_ARCHIVE_PREFIX: &str = "tmp-snapshot-archive-";
|
||||||
pub const BANK_SNAPSHOT_PRE_FILENAME_EXTENSION: &str = "pre";
|
pub const BANK_SNAPSHOT_PRE_FILENAME_EXTENSION: &str = "pre";
|
||||||
// Save some bank snapshots but not too many
|
|
||||||
pub const MAX_BANK_SNAPSHOTS_TO_RETAIN: usize = 8;
|
|
||||||
// The following unsafes are
|
// The following unsafes are
|
||||||
// - Safe because the values are fixed, known non-zero constants
|
// - Safe because the values are fixed, known non-zero constants
|
||||||
// - Necessary in order to have a plain NonZeroUsize as the constant, NonZeroUsize
|
// - Necessary in order to have a plain NonZeroUsize as the constant, NonZeroUsize
|
||||||
|
|
Loading…
Reference in New Issue