Add accounts-filler-size command line option (#23896)
This commit is contained in:
@@ -42,8 +42,8 @@ use {
|
||||
},
|
||||
solana_runtime::{
|
||||
accounts_db::{
|
||||
AccountShrinkThreshold, AccountsDbConfig, DEFAULT_ACCOUNTS_SHRINK_OPTIMIZE_TOTAL_SPACE,
|
||||
DEFAULT_ACCOUNTS_SHRINK_RATIO,
|
||||
AccountShrinkThreshold, AccountsDbConfig, FillerAccountsConfig,
|
||||
DEFAULT_ACCOUNTS_SHRINK_OPTIMIZE_TOTAL_SPACE, DEFAULT_ACCOUNTS_SHRINK_RATIO,
|
||||
},
|
||||
accounts_index::{
|
||||
AccountIndex, AccountSecondaryIndexes, AccountSecondaryIndexesIncludeExclude,
|
||||
@@ -1600,7 +1600,16 @@ pub fn main() {
|
||||
.value_name("COUNT")
|
||||
.validator(is_parsable::<usize>)
|
||||
.takes_value(true)
|
||||
.default_value("0")
|
||||
.help("How many accounts to add to stress the system. Accounts are ignored in operations related to correctness."))
|
||||
.arg(Arg::with_name("accounts_filler_size")
|
||||
.long("accounts-filler-size")
|
||||
.value_name("BYTES")
|
||||
.validator(is_parsable::<usize>)
|
||||
.takes_value(true)
|
||||
.default_value("0")
|
||||
.requires("accounts_filler_count")
|
||||
.help("Size per filler account in bytes."))
|
||||
.arg(
|
||||
Arg::with_name("accounts_db_test_hash_calculation")
|
||||
.long("accounts-db-test-hash-calculation")
|
||||
@@ -2251,11 +2260,15 @@ pub fn main() {
|
||||
.ok()
|
||||
.map(|mb| mb * MB);
|
||||
|
||||
let filler_account_count = value_t!(matches, "accounts_filler_count", usize).ok();
|
||||
let filler_accounts_config = FillerAccountsConfig {
|
||||
count: value_t_or_exit!(matches, "accounts_filler_count", usize),
|
||||
size: value_t_or_exit!(matches, "accounts_filler_size", usize),
|
||||
};
|
||||
|
||||
let mut accounts_db_config = AccountsDbConfig {
|
||||
index: Some(accounts_index_config),
|
||||
accounts_hash_cache_path: Some(ledger_path.clone()),
|
||||
filler_account_count,
|
||||
filler_accounts_config,
|
||||
write_cache_limit_bytes: value_t!(matches, "accounts_db_cache_limit_mb", u64)
|
||||
.ok()
|
||||
.map(|mb| mb * MB as u64),
|
||||
|
Reference in New Issue
Block a user