Skip to content

Commit

Permalink
check epoch epoch
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Jul 4, 2023
1 parent a6e8c36 commit 6811a9d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/engine_traits/src/flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct FlushProgress {
/// if the flushed index greater than it .
#[derive(Debug, Clone)]
pub struct SstApplyState {
// Map from sst meta to the apply index, <(cf_index)> --> [SstApplyEntry].
// Map from cf to SstApplyEntry.
sst_map: Arc<RwLock<HashMap<usize, Vec<SstApplyEntry>>>>,
}

Expand Down
4 changes: 3 additions & 1 deletion components/raftstore-v2/src/raft/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ impl<EK: KvEngine, ER> Storage<EK, ER> {

#[inline]
pub fn set_flushed_epoch(&mut self, epoch: RegionEpoch) {
self.flushed_epoch = epoch;
if util::is_epoch_stale(&self.flushed_epoch, &epoch) {
self.flushed_epoch = epoch;
}
}

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion components/test_raftstore-v2/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ impl<T: Simulator<EK>, EK: KvEngine> Cluster<T, EK> {
debug!("starting node {}", node_id);
let tablet_registry = self.tablet_registries[&node_id].clone();
let raft_engine = self.raft_engines[&node_id].clone();
let key_mgr: Option<Arc<DataKeyManager>> = self.key_managers_map[&node_id].clone();
let key_mgr = self.key_managers_map[&node_id].clone();
let cfg = self.cfg.clone();

// if let Some(labels) = self.labels.get(&node_id) {
Expand Down
1 change: 0 additions & 1 deletion tests/failpoints/cases/test_unsafe_recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ fn test_unsafe_recovery_execution_result_report() {
pdpb::CheckPolicy::Usekey,
vec![b"random_key1".to_vec()],
);

let region1 = pd_client.get_region(b"random_key".as_ref()).unwrap();
let region2 = pd_client.get_region(b"random_key1".as_ref()).unwrap();
let region1_store0_peer = find_peer(&region1, nodes[0]).unwrap().to_owned();
Expand Down

0 comments on commit 6811a9d

Please sign in to comment.