add arg --disable_accounts_disk_index (#23308)

This commit is contained in:
Jeff Washington (jwash)
2022-02-23 18:07:24 -06:00
committed by GitHub
parent c0d0724be0
commit 4bc440666a
2 changed files with 15 additions and 0 deletions

View File

@ -889,6 +889,10 @@ fn main() {
.validator(is_parsable::<usize>) .validator(is_parsable::<usize>)
.takes_value(true) .takes_value(true)
.help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory."); .help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory.");
let disable_disk_index = Arg::with_name("disable_accounts_disk_index")
.long("disable-accounts-disk-index")
.help("Disable the disk-based accounts index if it is enabled by default.")
.conflicts_with("accounts_index_memory_limit_mb");
let accountsdb_skip_shrink = Arg::with_name("accounts_db_skip_shrink") let accountsdb_skip_shrink = Arg::with_name("accounts_db_skip_shrink")
.long("accounts-db-skip-shrink") .long("accounts-db-skip-shrink")
.help( .help(
@ -1239,6 +1243,7 @@ fn main() {
.arg(&limit_load_slot_count_from_snapshot_arg) .arg(&limit_load_slot_count_from_snapshot_arg)
.arg(&accounts_index_bins) .arg(&accounts_index_bins)
.arg(&accounts_index_limit) .arg(&accounts_index_limit)
.arg(&disable_disk_index)
.arg(&accountsdb_skip_shrink) .arg(&accountsdb_skip_shrink)
.arg(&accounts_filler_count) .arg(&accounts_filler_count)
.arg(&verify_index_arg) .arg(&verify_index_arg)
@ -1991,6 +1996,8 @@ fn main() {
value_t!(arg_matches, "accounts_index_memory_limit_mb", usize).ok() value_t!(arg_matches, "accounts_index_memory_limit_mb", usize).ok()
{ {
accounts_index_config.index_limit_mb = Some(limit); accounts_index_config.index_limit_mb = Some(limit);
} else if arg_matches.is_present("disable_accounts_disk_index") {
accounts_index_config.index_limit_mb = None;
} }
{ {

View File

@ -1479,6 +1479,12 @@ pub fn main() {
.takes_value(true) .takes_value(true)
.help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory."), .help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory."),
) )
.arg(
Arg::with_name("disable_accounts_disk_index")
.long("disable-accounts-disk-index")
.help("Disable the disk-based accounts index if it is enabled by default.")
.conflicts_with("accounts_index_memory_limit_mb")
)
.arg( .arg(
Arg::with_name("accounts_index_bins") Arg::with_name("accounts_index_bins")
.long("accounts-index-bins") .long("accounts-index-bins")
@ -2126,6 +2132,8 @@ pub fn main() {
if let Some(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize).ok() { if let Some(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize).ok() {
accounts_index_config.index_limit_mb = Some(limit); accounts_index_config.index_limit_mb = Some(limit);
} else if matches.is_present("disable_accounts_disk_index") {
accounts_index_config.index_limit_mb = None;
} }
{ {