raft: use IsEmptySnap to check the empty snapshot

release-2.0
Yicheng Qin 2014-11-25 00:37:21 -08:00
parent e466126510
commit 8ee1bf31d6
1 changed files with 1 additions and 1 deletions

View File

@ -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