فهرست منبع

Move rf.last_applied right before yiedling snapshot.

Jing Yang 4 سال پیش
والد
کامیت
736ffa5d33
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      src/apply_command.rs

+ 1 - 0
src/apply_command.rs

@@ -42,6 +42,7 @@ where
                         );
                     }
                     if rf.last_applied < rf.log.start() {
+                        rf.last_applied = rf.log.start();
                         let (index_term, data) = rf.log.snapshot();
                         vec![ApplyCommandMessage::Snapshot(Snapshot {
                             last_included_index: index_term.index,