fix race in get_exclusive_storage() and load() (#3941)

* Revert "Revert "account storage is not in sync with the index after gc (#3914)" (#3936)"

This reverts commit 4f47fc00bc.

* fix get_exclusive_storage

* clippy
This commit is contained in:
Rob Walker
2019-04-23 09:56:36 -07:00
committed by GitHub
parent de6af95061
commit 5406d82d89
3 changed files with 255 additions and 178 deletions

View File

@@ -1,6 +1,6 @@
use crate::accounts_db::{
get_paths_vec, AccountInfo, AccountStorageSlice, AccountsDB, ErrorCounters,
InstructionAccounts, InstructionLoaders,
get_paths_vec, AccountInfo, AccountStorage, AccountsDB, ErrorCounters, InstructionAccounts,
InstructionLoaders,
};
use crate::accounts_index::{AccountsIndex, Fork};
use crate::append_vec::StoredAccount;
@@ -140,7 +140,7 @@ impl Accounts {
}
fn load_tx_accounts(
storage: &AccountStorageSlice,
storage: &AccountStorage,
ancestors: &HashMap<Fork, usize>,
accounts_index: &AccountsIndex<AccountInfo>,
tx: &Transaction,
@@ -180,7 +180,7 @@ impl Accounts {
}
fn load_executable_accounts(
storage: &AccountStorageSlice,
storage: &AccountStorage,
ancestors: &HashMap<Fork, usize>,
accounts_index: &AccountsIndex<AccountInfo>,
program_id: &Pubkey,
@@ -222,7 +222,7 @@ impl Accounts {
/// For each program_id in the transaction, load its loaders.
fn load_loaders(
storage: &AccountStorageSlice,
storage: &AccountStorage,
ancestors: &HashMap<Fork, usize>,
accounts_index: &AccountsIndex<AccountInfo>,
tx: &Transaction,