Эх сурвалжийг харах

Reset the step counter when append entries succeeded.

Jing Yang 5 жил өмнө
parent
commit
eed4e569f4
1 өөрчлөгдсөн 1 нэмэгдсэн , 0 устгасан
  1. 1 0
      src/lib.rs

+ 1 - 0
src/lib.rs

@@ -660,6 +660,7 @@ impl Raft {
                 if succeeded {
                     let mut rf = rf.lock();
                     rf.next_index[peer_index] = match_index + 1;
+                    rf.current_step[peer_index] = 0;
                     if match_index > rf.match_index[peer_index] {
                         rf.match_index[peer_index] = match_index;
                         if rf.is_leader() && rf.current_term == term {