Add comment for clear_unconfirmed_slot() in blockstore.rs (#21837)

This commit is contained in:
Yueh-Hsuan Chiang 2021-12-15 00:37:09 -08:00 committed by GitHub
parent e476e17abf
commit 71b12b1f56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -972,6 +972,13 @@ impl Blockstore {
Ok((newly_completed_data_sets, inserted_indices))
}
/// Range-delete all entries which prefix matches the specified `slot` and
/// clear all the related `SlotMeta` except its next_slots.
///
/// This function currently requires `insert_shreds_lock`, as both
/// `clear_unconfirmed_slot()` and `insert_shreds_handle_duplicate()`
/// try to perform read-modify-write operation on [`cf::SlotMeta`] column
/// family.
pub fn clear_unconfirmed_slot(&self, slot: Slot) {
let _lock = self.insert_shreds_lock.lock().unwrap();
if let Some(mut slot_meta) = self