Explorar o código

raft: use IsEmptySnap to check the empty snapshot

Yicheng Qin %!s(int64=11) %!d(string=hai) anos
pai
achega
8ee1bf31d6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -231,7 +231,7 @@ func (r *raft) sendAppend(to uint64) {
 		if err != nil {
 			panic(err) // TODO(bdarnell)
 		}
-		if snapshot.Metadata.Term == 0 {
+		if IsEmptySnap(snapshot) {
 			panic("need non-empty snapshot")
 		}
 		m.Snapshot = snapshot