فهرست منبع

Merge pull request #2012 from andybons/master

raft: add link to the paper raft_paper_test.go refers to
Yicheng Qin 11 سال پیش
والد
کامیت
7a2fa39e52
2فایلهای تغییر یافته به همراه6 افزوده شده و 6 حذف شده
  1. 1 1
      raft/log.go
  2. 5 5
      raft/raft_paper_test.go

+ 1 - 1
raft/log.go

@@ -42,7 +42,7 @@ type raftLog struct {
 }
 }
 
 
 // newLog returns log using the given storage. It recovers the log to the state
 // newLog returns log using the given storage. It recovers the log to the state
-// that it just commits and applies the lastest snapshot.
+// that it just commits and applies the latest snapshot.
 func newLog(storage Storage) *raftLog {
 func newLog(storage Storage) *raftLog {
 	if storage == nil {
 	if storage == nil {
 		log.Panic("storage must not be nil")
 		log.Panic("storage must not be nil")

+ 5 - 5
raft/raft_paper_test.go

@@ -16,14 +16,15 @@
 
 
 /*
 /*
 This file contains tests which verify that the scenarios described
 This file contains tests which verify that the scenarios described
-in raft paper are handled by the raft implementation correctly.
-Each test focuses on several sentences written in the paper. This could
-help us to prevent most implementation bugs.
+in the raft paper (https://ramcloud.stanford.edu/raft.pdf) are
+handled by the raft implementation correctly. Each test focuses on
+several sentences written in the paper. This could help us to prevent
+most implementation bugs.
 
 
 Each test is composed of three parts: init, test and check.
 Each test is composed of three parts: init, test and check.
 Init part uses simple and understandable way to simulate the init state.
 Init part uses simple and understandable way to simulate the init state.
 Test part uses Step function to generate the scenario. Check part checks
 Test part uses Step function to generate the scenario. Check part checks
-outgoint messages and state.
+outgoing messages and state.
 */
 */
 package raft
 package raft
 
 
@@ -32,7 +33,6 @@ import (
 	"io/ioutil"
 	"io/ioutil"
 	"log"
 	"log"
 	"os"
 	"os"
-
 	"reflect"
 	"reflect"
 	"sort"
 	"sort"
 	"testing"
 	"testing"