add metric for assumption (#17061)
This commit is contained in:
committed by
GitHub
parent
edc2ab3e48
commit
dc0429f5e6
@ -5,6 +5,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use bv::BitVec;
|
use bv::BitVec;
|
||||||
use dashmap::DashSet;
|
use dashmap::DashSet;
|
||||||
|
use log::*;
|
||||||
use ouroboros::self_referencing;
|
use ouroboros::self_referencing;
|
||||||
use solana_measure::measure::Measure;
|
use solana_measure::measure::Measure;
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
@ -1315,11 +1316,27 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
|
|||||||
pub fn clean_dead_slot(&self, slot: Slot) -> Option<AccountsIndexRootsStats> {
|
pub fn clean_dead_slot(&self, slot: Slot) -> Option<AccountsIndexRootsStats> {
|
||||||
let (roots_len, uncleaned_roots_len, previous_uncleaned_roots_len, roots_range) = {
|
let (roots_len, uncleaned_roots_len, previous_uncleaned_roots_len, roots_range) = {
|
||||||
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
|
let mut w_roots_tracker = self.roots_tracker.write().unwrap();
|
||||||
|
let removed_from_unclean_roots = w_roots_tracker.uncleaned_roots.remove(&slot);
|
||||||
|
let removed_from_previous_uncleaned_roots =
|
||||||
|
w_roots_tracker.previous_uncleaned_roots.remove(&slot);
|
||||||
if !w_roots_tracker.roots.remove(&slot) {
|
if !w_roots_tracker.roots.remove(&slot) {
|
||||||
|
if removed_from_unclean_roots {
|
||||||
|
error!("clean_dead_slot-removed_from_unclean_roots: {}", slot);
|
||||||
|
inc_new_counter_error!("clean_dead_slot-removed_from_unclean_roots", 1, 1);
|
||||||
|
}
|
||||||
|
if removed_from_previous_uncleaned_roots {
|
||||||
|
error!(
|
||||||
|
"clean_dead_slot-removed_from_previous_uncleaned_roots: {}",
|
||||||
|
slot
|
||||||
|
);
|
||||||
|
inc_new_counter_error!(
|
||||||
|
"clean_dead_slot-removed_from_previous_uncleaned_roots",
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
w_roots_tracker.uncleaned_roots.remove(&slot);
|
|
||||||
w_roots_tracker.previous_uncleaned_roots.remove(&slot);
|
|
||||||
(
|
(
|
||||||
w_roots_tracker.roots.len(),
|
w_roots_tracker.roots.len(),
|
||||||
w_roots_tracker.uncleaned_roots.len(),
|
w_roots_tracker.uncleaned_roots.len(),
|
||||||
@ -1414,7 +1431,6 @@ impl<T: 'static + Clone + IsCached + ZeroLamport> AccountsIndex<T> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
pub mod tests {
|
pub mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use log::*;
|
|
||||||
use solana_sdk::signature::{Keypair, Signer};
|
use solana_sdk::signature::{Keypair, Signer};
|
||||||
|
|
||||||
pub enum SecondaryIndexTypes<'a> {
|
pub enum SecondaryIndexTypes<'a> {
|
||||||
|
Reference in New Issue
Block a user