Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 4bc4406

Browse files
add arg --disable_accounts_disk_index (#23308)
1 parent c0d0724 commit 4bc4406

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ledger-tool/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,10 @@ fn main() {
889889
.validator(is_parsable::<usize>)
890890
.takes_value(true)
891891
.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.");
892+
let disable_disk_index = Arg::with_name("disable_accounts_disk_index")
893+
.long("disable-accounts-disk-index")
894+
.help("Disable the disk-based accounts index if it is enabled by default.")
895+
.conflicts_with("accounts_index_memory_limit_mb");
892896
let accountsdb_skip_shrink = Arg::with_name("accounts_db_skip_shrink")
893897
.long("accounts-db-skip-shrink")
894898
.help(
@@ -1239,6 +1243,7 @@ fn main() {
12391243
.arg(&limit_load_slot_count_from_snapshot_arg)
12401244
.arg(&accounts_index_bins)
12411245
.arg(&accounts_index_limit)
1246+
.arg(&disable_disk_index)
12421247
.arg(&accountsdb_skip_shrink)
12431248
.arg(&accounts_filler_count)
12441249
.arg(&verify_index_arg)
@@ -1991,6 +1996,8 @@ fn main() {
19911996
value_t!(arg_matches, "accounts_index_memory_limit_mb", usize).ok()
19921997
{
19931998
accounts_index_config.index_limit_mb = Some(limit);
1999+
} else if arg_matches.is_present("disable_accounts_disk_index") {
2000+
accounts_index_config.index_limit_mb = None;
19942001
}
19952002

19962003
{

validator/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,12 @@ pub fn main() {
14791479
.takes_value(true)
14801480
.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."),
14811481
)
1482+
.arg(
1483+
Arg::with_name("disable_accounts_disk_index")
1484+
.long("disable-accounts-disk-index")
1485+
.help("Disable the disk-based accounts index if it is enabled by default.")
1486+
.conflicts_with("accounts_index_memory_limit_mb")
1487+
)
14821488
.arg(
14831489
Arg::with_name("accounts_index_bins")
14841490
.long("accounts-index-bins")
@@ -2126,6 +2132,8 @@ pub fn main() {
21262132

21272133
if let Some(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize).ok() {
21282134
accounts_index_config.index_limit_mb = Some(limit);
2135+
} else if matches.is_present("disable_accounts_disk_index") {
2136+
accounts_index_config.index_limit_mb = None;
21292137
}
21302138

21312139
{

0 commit comments

Comments
 (0)