fn cleanup_overlap_ranges(&mut self, start_key: &[u8], end_key: &[u8]) {
        let overlap_ranges = self
            .pending_delete_ranges
            .drain_overlap_ranges(start_key, end_key);
        if overlap_ranges.is_empty() {
            return;
        }
        let oldest_sequence = self
            .engines
            .kv
            .get_oldest_snapshot_sequence_number()
            .unwrap_or(u64::MAX);
        for (region_id, s_key, e_key, stale_sequence) in overlap_ranges {
            // `delete_files_in_range` may break current rocksdb snapshots consistency,
            // so do not use it unless we can make sure there is no reader of the destroyed peer anymore.
            let use_delete_files = stale_sequence < oldest_sequence;
            if !use_delete_files {
                SNAP_COUNTER_VEC
                    .with_label_values(&["overlap", "not_delete_files"])
                    .inc();
            }
            self.cleanup_range(region_id, &s_key, &e_key, use_delete_files);
        }
    }
/// Gets the overlapping ranges and cleans them up.
Gets the overlapping ranges and cleans them up.
Gets the overlapping ranges and cleans them up .
fn cleanup_overlap_ranges(&mut self, start_key: &[u8], end_key: &[u8]) {
        let overlap_ranges = self
            .pending_delete_ranges
            .drain_overlap_ranges(start_key, end_key);
        if overlap_ranges.is_empty() {
            return;
        }
        let oldest_sequence = self
            .engines
            .kv
            .get_oldest_snapshot_sequence_number()
            .unwrap_or(u64::MAX);
        for (region_id, s_key, e_key, stale_sequence) in overlap_ranges {
            // `delete_files_in_range` may break current rocksdb snapshots consistency,
            // so do not use it unless we can make sure there is no reader of the destroyed peer anymore.
            let use_delete_files = stale_sequence < oldest_sequence;
            if !use_delete_files {
                SNAP_COUNTER_VEC
                    .with_label_values(&["overlap", "not_delete_files"])
                    .inc();
            }
            self.cleanup_range(region_id, &s_key, &e_key, use_delete_files);
        }
    }
fn cleanup_overlap_ranges ( & mut self , start_key : & [ u8 ] , end_key : & [ u8 ] ) { let overlap_ranges = self . pending_delete_ranges . drain_overlap_ranges ( start_key , end_key ) ; if overlap_ranges . is_empty ( ) { return ; } let oldest_sequence = self . engines . kv . get_oldest_snapshot_sequence_number ( ) . unwrap_or ( u64 :: MAX ) ; for ( region_id , s_key , e_key , stale_sequence ) in overlap_ranges { // `delete_files_in_range` may break current rocksdb snapshots consistency, // so do not use it unless we can make sure there is no reader of the destroyed peer anymore. let use_delete_files = stale_sequence < oldest_sequence ; if ! use_delete_files { SNAP_COUNTER_VEC . with_label_values ( & [ " " , " " ] ) . inc ( ) ; } self . cleanup_range ( region_id , & s_key , & e_key , use_delete_files ) ; } }
Gets the overlapping ranges and cleans them up.
Gets the overlapping ranges and cleans them up .
&mut self
start_key
&[u8]
end_key
&[u8]