This reverts commit 002693ab7d
.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
accounts_db::{
|
||||
AccountShrinkThreshold, AccountsAddRootTiming, AccountsDb, BankHashInfo, ErrorCounters,
|
||||
LoadHint, LoadedAccount, ScanStorageResult,
|
||||
AccountShrinkThreshold, AccountsDb, BankHashInfo, ErrorCounters, LoadHint, LoadedAccount,
|
||||
ScanStorageResult,
|
||||
},
|
||||
accounts_index::{AccountSecondaryIndexes, IndexKey, ScanResult},
|
||||
accounts_update_notifier_interface::AccountsUpdateNotifier,
|
||||
@ -975,7 +975,7 @@ impl Accounts {
|
||||
}
|
||||
|
||||
/// Add a slot to root. Root slots cannot be purged
|
||||
pub fn add_root(&self, slot: Slot) -> AccountsAddRootTiming {
|
||||
pub fn add_root(&self, slot: Slot) {
|
||||
self.accounts_db.add_root(slot)
|
||||
}
|
||||
|
||||
|
@ -104,12 +104,6 @@ const CACHE_VIRTUAL_WRITE_VERSION: StoredMetaWriteVersion = 0;
|
||||
const CACHE_VIRTUAL_OFFSET: usize = 0;
|
||||
const CACHE_VIRTUAL_STORED_SIZE: usize = 0;
|
||||
|
||||
pub struct AccountsAddRootTiming {
|
||||
pub index_us: u64,
|
||||
pub cache_us: u64,
|
||||
pub store_us: u64,
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
const ABSURD_CONSECUTIVE_FAILED_ITERATIONS: usize = 100;
|
||||
|
||||
@ -5799,28 +5793,16 @@ impl AccountsDb {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_root(&self, slot: Slot) -> AccountsAddRootTiming {
|
||||
let mut index_time = Measure::start("index_add_root");
|
||||
pub fn add_root(&self, slot: Slot) {
|
||||
self.accounts_index.add_root(slot, self.caching_enabled);
|
||||
index_time.stop();
|
||||
let mut cache_time = Measure::start("cache_add_root");
|
||||
if self.caching_enabled {
|
||||
self.accounts_cache.add_root(slot);
|
||||
}
|
||||
cache_time.stop();
|
||||
let mut store_time = Measure::start("store_add_root");
|
||||
if let Some(slot_stores) = self.storage.get_slot_stores(slot) {
|
||||
for (store_id, store) in slot_stores.read().unwrap().iter() {
|
||||
self.dirty_stores.insert((slot, *store_id), store.clone());
|
||||
}
|
||||
}
|
||||
store_time.stop();
|
||||
|
||||
AccountsAddRootTiming {
|
||||
index_us: index_time.as_us(),
|
||||
cache_us: cache_time.as_us(),
|
||||
store_us: store_time.as_us(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_snapshot_storages(
|
||||
|
@ -241,10 +241,6 @@ type RentCollectionCycleParams = (
|
||||
|
||||
pub struct SquashTiming {
|
||||
pub squash_accounts_ms: u64,
|
||||
pub squash_accounts_cache_ms: u64,
|
||||
pub squash_accounts_index_ms: u64,
|
||||
pub squash_accounts_store_ms: u64,
|
||||
|
||||
pub squash_cache_ms: u64,
|
||||
}
|
||||
|
||||
@ -2835,17 +2831,10 @@ impl Bank {
|
||||
let mut roots = vec![self.slot()];
|
||||
roots.append(&mut self.parents().iter().map(|p| p.slot()).collect());
|
||||
|
||||
let mut total_index_us = 0;
|
||||
let mut total_cache_us = 0;
|
||||
let mut total_store_us = 0;
|
||||
|
||||
let mut squash_accounts_time = Measure::start("squash_accounts_time");
|
||||
for slot in roots.iter().rev() {
|
||||
// root forks cannot be purged
|
||||
let add_root_timing = self.rc.accounts.add_root(*slot);
|
||||
total_index_us += add_root_timing.index_us;
|
||||
total_cache_us += add_root_timing.cache_us;
|
||||
total_store_us += add_root_timing.store_us;
|
||||
self.rc.accounts.add_root(*slot);
|
||||
}
|
||||
squash_accounts_time.stop();
|
||||
|
||||
@ -2859,10 +2848,6 @@ impl Bank {
|
||||
|
||||
SquashTiming {
|
||||
squash_accounts_ms: squash_accounts_time.as_ms(),
|
||||
squash_accounts_index_ms: total_index_us / 1000,
|
||||
squash_accounts_cache_ms: total_cache_us / 1000,
|
||||
squash_accounts_store_ms: total_store_us / 1000,
|
||||
|
||||
squash_cache_ms: squash_cache_time.as_ms(),
|
||||
}
|
||||
}
|
||||
|
@ -52,9 +52,6 @@ struct SetRootTimings {
|
||||
total_parent_banks: i64,
|
||||
total_squash_cache_ms: i64,
|
||||
total_squash_accounts_ms: i64,
|
||||
total_squash_accounts_index_ms: i64,
|
||||
total_squash_accounts_cache_ms: i64,
|
||||
total_squash_accounts_store_ms: i64,
|
||||
total_snapshot_ms: i64,
|
||||
tx_count: i64,
|
||||
prune_non_rooted_ms: i64,
|
||||
@ -258,9 +255,6 @@ impl BankForks {
|
||||
banks.extend(parents.iter());
|
||||
let total_parent_banks = banks.len();
|
||||
let mut total_squash_accounts_ms = 0;
|
||||
let mut total_squash_accounts_index_ms = 0;
|
||||
let mut total_squash_accounts_cache_ms = 0;
|
||||
let mut total_squash_accounts_store_ms = 0;
|
||||
let mut total_squash_cache_ms = 0;
|
||||
let mut total_snapshot_ms = 0;
|
||||
for bank in banks.iter() {
|
||||
@ -271,9 +265,6 @@ impl BankForks {
|
||||
self.last_accounts_hash_slot = bank_slot;
|
||||
let squash_timing = bank.squash();
|
||||
total_squash_accounts_ms += squash_timing.squash_accounts_ms as i64;
|
||||
total_squash_accounts_index_ms += squash_timing.squash_accounts_index_ms as i64;
|
||||
total_squash_accounts_cache_ms += squash_timing.squash_accounts_cache_ms as i64;
|
||||
total_squash_accounts_store_ms += squash_timing.squash_accounts_store_ms as i64;
|
||||
total_squash_cache_ms += squash_timing.squash_cache_ms as i64;
|
||||
is_root_bank_squashed = bank_slot == root;
|
||||
|
||||
@ -306,9 +297,6 @@ impl BankForks {
|
||||
if !is_root_bank_squashed {
|
||||
let squash_timing = root_bank.squash();
|
||||
total_squash_accounts_ms += squash_timing.squash_accounts_ms as i64;
|
||||
total_squash_accounts_index_ms += squash_timing.squash_accounts_index_ms as i64;
|
||||
total_squash_accounts_cache_ms += squash_timing.squash_accounts_cache_ms as i64;
|
||||
total_squash_accounts_store_ms += squash_timing.squash_accounts_store_ms as i64;
|
||||
total_squash_cache_ms += squash_timing.squash_cache_ms as i64;
|
||||
}
|
||||
let new_tx_count = root_bank.transaction_count();
|
||||
@ -328,9 +316,6 @@ impl BankForks {
|
||||
total_parent_banks: total_parent_banks as i64,
|
||||
total_squash_cache_ms,
|
||||
total_squash_accounts_ms,
|
||||
total_squash_accounts_index_ms,
|
||||
total_squash_accounts_cache_ms,
|
||||
total_squash_accounts_store_ms,
|
||||
total_snapshot_ms,
|
||||
tx_count: (new_tx_count - root_tx_count) as i64,
|
||||
prune_non_rooted_ms: prune_time.as_ms() as i64,
|
||||
@ -378,21 +363,6 @@ impl BankForks {
|
||||
set_root_metrics.total_squash_accounts_ms,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"total_squash_accounts_index_ms",
|
||||
set_root_metrics.total_squash_accounts_index_ms,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"total_squash_accounts_cache_ms",
|
||||
set_root_metrics.total_squash_accounts_cache_ms,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"total_squash_accounts_store_ms",
|
||||
set_root_metrics.total_squash_accounts_store_ms,
|
||||
i64
|
||||
),
|
||||
("total_snapshot_ms", set_root_metrics.total_snapshot_ms, i64),
|
||||
("tx_count", set_root_metrics.tx_count, i64),
|
||||
(
|
||||
|
Reference in New Issue
Block a user