Cache account stores, flush from AccountsBackgroundService (#13140)

This commit is contained in:
carllin
2021-01-11 17:00:23 -08:00
committed by GitHub
parent 4a66e3eddc
commit 6dfad0652f
25 changed files with 2604 additions and 833 deletions

View File

@@ -581,6 +581,7 @@ pub fn remove_snapshot<P: AsRef<Path>>(slot: Slot, snapshot_path: P) -> Result<(
Ok(())
}
#[allow(clippy::too_many_arguments)]
pub fn bank_from_archive<P: AsRef<Path>>(
account_paths: &[PathBuf],
frozen_account_pubkeys: &[Pubkey],
@@ -591,6 +592,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
debug_keys: Option<Arc<HashSet<Pubkey>>>,
additional_builtins: Option<&Builtins>,
account_indexes: HashSet<AccountIndex>,
accounts_db_caching_enabled: bool,
) -> Result<Bank> {
// Untar the snapshot into a temporary directory
let unpack_dir = tempfile::Builder::new()
@@ -616,6 +618,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
debug_keys,
additional_builtins,
account_indexes,
accounts_db_caching_enabled,
)?;
if !bank.verify_snapshot_bank() {
@@ -752,6 +755,7 @@ pub fn untar_snapshot_in<P: AsRef<Path>, Q: AsRef<Path>>(
Ok(())
}
#[allow(clippy::too_many_arguments)]
fn rebuild_bank_from_snapshots<P>(
snapshot_version: &str,
account_paths: &[PathBuf],
@@ -762,6 +766,7 @@ fn rebuild_bank_from_snapshots<P>(
debug_keys: Option<Arc<HashSet<Pubkey>>>,
additional_builtins: Option<&Builtins>,
account_indexes: HashSet<AccountIndex>,
accounts_db_caching_enabled: bool,
) -> Result<Bank>
where
P: AsRef<Path>,
@@ -799,6 +804,7 @@ where
debug_keys,
additional_builtins,
account_indexes,
accounts_db_caching_enabled,
),
}?)
})?;