Make the default values of FIFO compaction consistent with validator args (#25778)
#### Problem When FIFO compaction is used, the size ratio between data shred and coding shred is set to 1:1 based on the `--rocksdb_fifo_shred_storage_size` arg. However, BlockstoreRocksFifoOptions::default() uses a slightly optimized 5:4 ratio instead, and the default() function is only used in benchmarks. #### Summary of Changes This PR makes both validator argument and BlockstoreRocksFifoOptions::default() to use 1:1 ratio between data and coding shred size.
This commit is contained in:
parent
c8e8e81c23
commit
8674c96a66
|
@ -46,11 +46,6 @@ use {
|
|||
|
||||
const BLOCKSTORE_METRICS_ERROR: i64 = -1;
|
||||
|
||||
// The default storage size for storing shreds when `rocksdb-shred-compaction`
|
||||
// is set to `fifo` in the validator arguments. This amount of storage size
|
||||
// in bytes will equally allocated to both data shreds and coding shreds.
|
||||
pub const DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES: u64 = 250 * 1024 * 1024 * 1024;
|
||||
|
||||
const MAX_WRITE_BUFFER_SIZE: u64 = 256 * 1024 * 1024; // 256MB
|
||||
const FIFO_WRITE_BUFFER_SIZE: u64 = 2 * MAX_WRITE_BUFFER_SIZE;
|
||||
|
||||
|
|
|
@ -155,24 +155,18 @@ pub struct BlockstoreRocksFifoOptions {
|
|||
pub shred_code_cf_size: u64,
|
||||
}
|
||||
|
||||
// Maximum size of cf::DataShred. Used when `shred_storage_type`
|
||||
// is set to ShredStorageType::RocksFifo. The default value is set
|
||||
// to 125GB, assuming 500GB total storage for ledger and 25% is
|
||||
// used by data shreds.
|
||||
const DEFAULT_FIFO_COMPACTION_DATA_CF_SIZE: u64 = 125 * 1024 * 1024 * 1024;
|
||||
// Maximum size of cf::CodeShred. Used when `shred_storage_type`
|
||||
// is set to ShredStorageType::RocksFifo. The default value is set
|
||||
// to 100GB, assuming 500GB total storage for ledger and 20% is
|
||||
// used by coding shreds.
|
||||
const DEFAULT_FIFO_COMPACTION_CODING_CF_SIZE: u64 = 100 * 1024 * 1024 * 1024;
|
||||
// The default storage size for storing shreds when `rocksdb-shred-compaction`
|
||||
// is set to `fifo` in the validator arguments. This amount of storage size
|
||||
// in bytes will equally allocated to both data shreds and coding shreds.
|
||||
pub const DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES: u64 = 250 * 1024 * 1024 * 1024;
|
||||
|
||||
impl Default for BlockstoreRocksFifoOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
// Maximum size of cf::ShredData.
|
||||
shred_data_cf_size: DEFAULT_FIFO_COMPACTION_DATA_CF_SIZE,
|
||||
shred_data_cf_size: DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES / 2,
|
||||
// Maximum size of cf::ShredCode.
|
||||
shred_code_cf_size: DEFAULT_FIFO_COMPACTION_CODING_CF_SIZE,
|
||||
shred_code_cf_size: DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES / 2,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,12 +30,9 @@ use {
|
|||
validator::{is_snapshot_config_valid, Validator, ValidatorConfig, ValidatorStartProgress},
|
||||
},
|
||||
solana_gossip::{cluster_info::Node, contact_info::ContactInfo},
|
||||
solana_ledger::{
|
||||
blockstore_db::DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES,
|
||||
blockstore_options::{
|
||||
BlockstoreCompressionType, BlockstoreRecoveryMode, BlockstoreRocksFifoOptions,
|
||||
LedgerColumnOptions, ShredStorageType,
|
||||
},
|
||||
solana_ledger::blockstore_options::{
|
||||
BlockstoreCompressionType, BlockstoreRecoveryMode, BlockstoreRocksFifoOptions,
|
||||
LedgerColumnOptions, ShredStorageType, DEFAULT_ROCKS_FIFO_SHRED_STORAGE_SIZE_BYTES,
|
||||
},
|
||||
solana_net_utils::VALIDATOR_PORT_RANGE,
|
||||
solana_perf::recycler::enable_recycler_warming,
|
||||
|
|
Loading…
Reference in New Issue