Skip to content

Commit

Permalink
Use MembershipState for snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Dec 15, 2020
1 parent 11e4621 commit 941fcda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dgraph/cmd/zero/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func (n *node) applySnapshot(snap *pb.ZeroSnapshot) error {
}
n.server.orc.purgeBelow(snap.CheckpointTs)

data, err := snap.Marshal()
data, err := snap.GetState().Marshal()
x.Check(err)

for {
Expand Down Expand Up @@ -546,11 +546,11 @@ func (n *node) initAndStartNode() error {
// It is important that we pick up the conf state here.
n.SetConfState(&sp.Metadata.ConfState)

var zs pb.ZeroSnapshot
x.Check(zs.Unmarshal(sp.Data))
n.server.SetMembershipState(zs.State)
var ms pb.MembershipState
x.Check(ms.Unmarshal(sp.Data))
n.server.SetMembershipState(&ms)
for _, id := range sp.Metadata.ConfState.Nodes {
n.Connect(id, zs.State.Zeros[id].Addr)
n.Connect(id, ms.Zeros[id].Addr)
}
}

Expand Down

0 comments on commit 941fcda

Please sign in to comment.