Skip to content

Commit

Permalink
fix order in join too
Browse files Browse the repository at this point in the history
  • Loading branch information
jbowens authored and iampogo committed Jun 13, 2017
1 parent c97cfe2 commit 7cab800
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions database/raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,17 +666,17 @@ func (sv *Service) join(addr, baseURL string) (*wal.WAL, error) {
}

if !raft.IsEmptySnap(raftSnap) {
err := sv.saveSnapshot(&raftSnap)
if err != nil {
return nil, errors.Wrap(err)
}
err = wal.SaveSnapshot(walpb.Snapshot{
err := wal.SaveSnapshot(walpb.Snapshot{
Index: raftSnap.Metadata.Index,
Term: raftSnap.Metadata.Term,
})
if err != nil {
return nil, errors.Wrap(err)
}
err = sv.saveSnapshot(&raftSnap)
if err != nil {
return nil, errors.Wrap(err)
}
err = sv.state.RestoreSnapshot(raftSnap.Data, raftSnap.Metadata.Index)
if err != nil {
return nil, errors.Wrap(err)
Expand Down

0 comments on commit 7cab800

Please sign in to comment.