Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release(v20.11): unmarshal snapshot onto zerosnapshot instead of membershipState (#7125) #7128

Merged
merged 1 commit into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions dgraph/cmd/debug/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func printBasic(store RaftStore) (uint64, uint64) {
} else {
fmt.Printf("Snapshot Metadata: %+v\n", snap.Metadata)
var ds pb.Snapshot
var ms pb.MembershipState
var zs pb.ZeroSnapshot
if err := ds.Unmarshal(snap.Data); err == nil {
fmt.Printf("Snapshot Alpha: %+v\n", ds)
} else if err := ms.Unmarshal(snap.Data); err == nil {
for gid, group := range ms.GetGroups() {
} else if err := zs.Unmarshal(snap.Data); err == nil {
for gid, group := range zs.State.GetGroups() {
fmt.Printf("\nGROUP: %d\n", gid)
for _, member := range group.GetMembers() {
fmt.Printf("Member: %+v .\n", member)
Expand All @@ -87,8 +87,8 @@ func printBasic(store RaftStore) (uint64, uint64) {
group.Tablets = nil
fmt.Printf("Group: %d %+v .\n", gid, group)
}
ms.Groups = nil
fmt.Printf("\nSnapshot Zero: %+v\n", ms)
zs.State.Groups = nil
fmt.Printf("\nSnapshot Zero: %+v\n", zs)
} else {
fmt.Printf("Unable to unmarshal Dgraph snapshot: %v", err)
}
Expand Down
8 changes: 4 additions & 4 deletions dgraph/cmd/zero/raft.go
Original file line number Diff line number Diff line change
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 state pb.MembershipState
x.Check(state.Unmarshal(sp.Data))
n.server.SetMembershipState(&state)
var zs pb.ZeroSnapshot
x.Check(zs.Unmarshal(sp.Data))
n.server.SetMembershipState(zs.State)
for _, id := range sp.Metadata.ConfState.Nodes {
n.Connect(id, state.Zeros[id].Addr)
n.Connect(id, zs.State.Zeros[id].Addr)
}
}

Expand Down