diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 2c343c4f65547e..a7a822a8290be4 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -889,6 +889,10 @@ fn main() { .validator(is_parsable::) .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."); + 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") .long("accounts-db-skip-shrink") .help( @@ -1239,6 +1243,7 @@ fn main() { .arg(&limit_load_slot_count_from_snapshot_arg) .arg(&accounts_index_bins) .arg(&accounts_index_limit) + .arg(&disable_disk_index) .arg(&accountsdb_skip_shrink) .arg(&accounts_filler_count) .arg(&verify_index_arg) @@ -1991,6 +1996,8 @@ fn main() { value_t!(arg_matches, "accounts_index_memory_limit_mb", usize).ok() { 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; } { diff --git a/validator/src/main.rs b/validator/src/main.rs index 2997d60b543944..90c03172a6e235 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1479,6 +1479,12 @@ pub fn main() { .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."), ) + .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::with_name("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() { accounts_index_config.index_limit_mb = Some(limit); + } else if matches.is_present("disable_accounts_disk_index") { + accounts_index_config.index_limit_mb = None; } {