Skip to content

Commit

Permalink
add arg --disable_accounts_disk_index (#23308)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Feb 24, 2022
1 parent c0d0724 commit 4bc4406
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,10 @@ fn main() {
.validator(is_parsable::<usize>)
.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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

{
Expand Down
8 changes: 8 additions & 0 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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;
}

{
Expand Down

0 comments on commit 4bc4406

Please sign in to comment.