Browse Source

raft: use IsEmptySnap to check the empty snapshot

Yicheng Qin 11 years ago
parent
commit
8ee1bf31d6
1 changed files with 1 additions and 1 deletions
  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