pub fn clean_dead_slot(&self, slot: Slot) -> Option<AccountsIndexRootsStats> {
        let (roots_len, uncleaned_roots_len, previous_uncleaned_roots_len, roots_range) = {
            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 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;
            }
            (
                w_roots_tracker.roots.len(),
                w_roots_tracker.uncleaned_roots.len(),
                w_roots_tracker.previous_uncleaned_roots.len(),
                w_roots_tracker.roots.range_width(),
            )
        };
        Some(AccountsIndexRootsStats {
            roots_len,
            uncleaned_roots_len,
            previous_uncleaned_roots_len,
            roots_range,
            rooted_cleaned_count: 0,
            unrooted_cleaned_count: 0,
        })
    }
/// Remove the slot when the storage for the slot is freed
/// Accounts no longer reference this slot.
Remove the slot when the storage for the slot is freed
Accounts no longer reference this slot.
Remove the slot when the storage for the slot is freed Accounts no longer reference this slot .
pub fn clean_dead_slot(&self, slot: Slot) -> Option<AccountsIndexRootsStats> {
        let (roots_len, uncleaned_roots_len, previous_uncleaned_roots_len, roots_range) = {
            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 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;
            }
            (
                w_roots_tracker.roots.len(),
                w_roots_tracker.uncleaned_roots.len(),
                w_roots_tracker.previous_uncleaned_roots.len(),
                w_roots_tracker.roots.range_width(),
            )
        };
        Some(AccountsIndexRootsStats {
            roots_len,
            uncleaned_roots_len,
            previous_uncleaned_roots_len,
            roots_range,
            rooted_cleaned_count: 0,
            unrooted_cleaned_count: 0,
        })
    }
pub fn clean_dead_slot ( & self , slot : Slot ) -> Option < AccountsIndexRootsStats > { let ( roots_len , uncleaned_roots_len , previous_uncleaned_roots_len , roots_range ) = { 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 removed_from_unclean_roots { error ! ( " " slot ) ; inc_new_counter_error ! ( " " 1 1 ) ; } if removed_from_previous_uncleaned_roots { error ! ( " " slot ) ; inc_new_counter_error ! ( " " 1 1 ) ; } return None ; } ( w_roots_tracker . roots . len ( ) , w_roots_tracker . uncleaned_roots . len ( ) , w_roots_tracker . previous_uncleaned_roots . len ( ) , w_roots_tracker . roots . range_width ( ) , ) } ; Some ( AccountsIndexRootsStats { roots_len , uncleaned_roots_len , previous_uncleaned_roots_len , roots_range , rooted_cleaned_count : 0 , unrooted_cleaned_count : 0 , } ) }
Remove the slot when the storage for the slot is freed
Accounts no longer reference this slot.
Remove the slot when the storage for the slot is freed Accounts no longer reference this slot .
&self
slot
Slot
&self
slot
Slot