diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 9cc982567..12bf62fef 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -1912,6 +1912,15 @@ fn main() { if let Some(bins) = value_t!(matches, "accounts_index_bins", usize).ok() { accounts_index_config.bins = Some(bins); } + + { + let mut accounts_index_paths = vec![]; // will be option + if accounts_index_paths.is_empty() { + accounts_index_paths = vec![ledger_path.join("accounts_index")]; + } + accounts_index_config.drives = Some(accounts_index_paths); + } + let accounts_db_config = Some(AccountsDbConfig { index: Some(accounts_index_config), accounts_hash_cache_path: Some(ledger_path.clone()), diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 961d23eaf..cf74cb5c7 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -23,6 +23,7 @@ use std::{ Bound::{Excluded, Included, Unbounded}, Range, RangeBounds, }, + path::PathBuf, sync::{ atomic::{AtomicBool, AtomicU64, Ordering}, Arc, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard, @@ -38,10 +39,12 @@ pub const FLUSH_THREADS_TESTING: usize = 1; pub const ACCOUNTS_INDEX_CONFIG_FOR_TESTING: AccountsIndexConfig = AccountsIndexConfig { bins: Some(BINS_FOR_TESTING), flush_threads: Some(FLUSH_THREADS_TESTING), + drives: None, }; pub const ACCOUNTS_INDEX_CONFIG_FOR_BENCHMARKS: AccountsIndexConfig = AccountsIndexConfig { bins: Some(BINS_FOR_BENCHMARKS), flush_threads: Some(FLUSH_THREADS_TESTING), + drives: None, }; pub type ScanResult = Result; pub type SlotList = Vec<(Slot, T)>; @@ -97,6 +100,7 @@ pub struct AccountSecondaryIndexesIncludeExclude { pub struct AccountsIndexConfig { pub bins: Option, pub flush_threads: Option, + pub drives: Option>, } #[derive(Debug, Default, Clone)] diff --git a/validator/src/main.rs b/validator/src/main.rs index fe2ebe2e1..41d04e580 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -2512,6 +2512,14 @@ pub fn main() { accounts_index_config.bins = Some(bins); } + { + let mut accounts_index_paths = vec![]; // will be option soon + if accounts_index_paths.is_empty() { + accounts_index_paths = vec![ledger_path.join("accounts_index")]; + } + accounts_index_config.drives = Some(accounts_index_paths); + } + let accounts_db_config = Some(AccountsDbConfig { index: Some(accounts_index_config), accounts_hash_cache_path: Some(ledger_path.clone()),