Skip to content

Commit

Permalink
store: change box err to stale epoch error (tikv#2595)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored Dec 19, 2017
1 parent 9a57720 commit 3c69644
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/raftstore/store/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1918,19 +1918,23 @@ impl<T: Transport, C: PdClient> Store<T, C> {
};

let region = peer.region();
let latest_epoch = region.get_region_epoch();

if region.get_region_epoch().get_version() != epoch.get_version() {
if latest_epoch.get_version() != epoch.get_version() {
info!(
"{} epoch changed {:?} != {:?}, need re-check later",
"{} epoch changed {:?} != {:?}, retry later",
peer.tag,
region.get_region_epoch(),
epoch
);
return Err(box_err!(
"{} epoch changed {:?} != {:?}, need re-check later",
peer.tag,
region.get_region_epoch(),
epoch
return Err(Error::StaleEpoch(
format!(
"{} epoch changed {:?} != {:?}, retry later",
peer.tag,
latest_epoch,
epoch
),
vec![region.to_owned()],
));
}
Ok(())
Expand Down

0 comments on commit 3c69644

Please sign in to comment.