Skip to content

Commit

Permalink
Transient accounts hash cache dir is unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Sep 11, 2023
1 parent 6298c6c commit 9b3a92a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ use {
borrow::{Borrow, Cow},
boxed::Box,
collections::{hash_map, BTreeSet, HashMap, HashSet},
fs,
hash::{Hash as StdHash, Hasher as StdHasher},
io::Result as IoResult,
ops::{Range, RangeBounds},
Expand Down Expand Up @@ -1494,7 +1493,6 @@ pub struct AccountsDb {
base_working_temp_dir: Option<TempDir>,

accounts_hash_cache_path: PathBuf,
transient_accounts_hash_cache_path: PathBuf,

pub shrink_paths: RwLock<Option<Vec<PathBuf>>>,

Expand Down Expand Up @@ -2499,7 +2497,6 @@ impl AccountsDb {
paths: vec![],
base_working_path,
base_working_temp_dir,
transient_accounts_hash_cache_path: accounts_hash_cache_path.join("transient"),
accounts_hash_cache_path,
shrink_paths: RwLock::new(None),
temp_paths: None,
Expand Down Expand Up @@ -7735,7 +7732,7 @@ impl AccountsDb {
let accounts_hash_cache_path = self.accounts_hash_cache_path.clone();
let scan_and_hash = || {
let (cache_hash_data, cache_hash_data_us) = measure_us!(Self::get_cache_hash_data(
accounts_hash_cache_path,
accounts_hash_cache_path.clone(),
config,
kind,
slot
Expand All @@ -7747,16 +7744,14 @@ impl AccountsDb {
end: PUBKEY_BINS_FOR_CALCULATING_HASHES,
};

fs::create_dir_all(&self.transient_accounts_hash_cache_path)
.expect("create transient accounts hash cache dir");
let accounts_hasher = AccountsHasher {
filler_account_suffix: if self.filler_accounts_config.count > 0 {
self.filler_account_suffix
} else {
None
},
zero_lamport_accounts: kind.zero_lamport_accounts(),
dir_for_temp_cache_files: self.transient_accounts_hash_cache_path.clone(),
dir_for_temp_cache_files: accounts_hash_cache_path,
active_stats: &self.active_stats,
};

Expand Down

0 comments on commit 9b3a92a

Please sign in to comment.