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 5f8f377
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions 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 Expand Up @@ -302,9 +302,7 @@ impl<R: RaftEngine> StateStorage for R {
#[cfg(test)]
mod test {
use std::vec;

use kvproto::import_sstpb::SstMeta;

use super::SstApplyState;

#[test]
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
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 5f8f377

Please sign in to comment.