Skip to content

Commit

Permalink
minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing committed Oct 11, 2016
1 parent fbaa435 commit f9e37d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/raftstore/store/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,6 @@ impl Peer {
debug!("{} propose command with uuid {:?}", self.tag, cmd.uuid);
PEER_PROPOSAL_COUNTER_VEC.with_label_values(&["all"]).inc();

if let Err(e) = self.check_epoch(&req) {
cmd_resp::bind_error(&mut err_resp, e);
return cmd.cb.call_box((err_resp,));
}

let local_read = self.is_local_read(&req);
if local_read {
PEER_PROPOSAL_COUNTER_VEC.with_label_values(&["local_read"]).inc();
Expand Down
5 changes: 2 additions & 3 deletions src/raftstore/store/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,13 +946,12 @@ impl<T: Transport, C: PdClient> Store<T, C> {
// but it doesn't matter, if the peer is not leader, the proposing command
// log entry can't be committed.


let mut peer = self.region_peers.get_mut(&region_id).unwrap();
let pending_cmd = PendingCmd {
uuid: uuid,
term: resp.get_header().get_current_term(),
term: peer.term(),
cb: cb,
};
let mut peer = self.region_peers.get_mut(&region_id).unwrap();
try!(peer.propose(pending_cmd, msg, resp));

self.pending_raft_groups.insert(region_id);
Expand Down

0 comments on commit f9e37d2

Please sign in to comment.