瀏覽代碼

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,