Просмотр исходного кода

No need to re-sync the log entry that has been committed.

Jing Yang 3 лет назад
Родитель
Сommit
138060b85d
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/sync_log_entries.rs

+ 1 - 1
src/sync_log_entries.rs

@@ -294,7 +294,7 @@ where
                 // Next index moves towards the log end. This is the only place
                 // Next index moves towards the log end. This is the only place
                 // where that happens. committed.index should be between log
                 // where that happens. committed.index should be between log
                 // start and end, guaranteed by check_committed() above.
                 // start and end, guaranteed by check_committed() above.
-                rf.next_index[peer_index] = committed.index;
+                rf.next_index[peer_index] = committed.index + 1;
 
 
                 // Ignore the error. The log syncing thread must have died.
                 // Ignore the error. The log syncing thread must have died.
                 let _ = rerun.send(Some(Peer(peer_index)));
                 let _ = rerun.send(Some(Peer(peer_index)));