Fix migration to allow snapshots to have the right IDs
This commit is contained in:
@ -171,15 +171,17 @@ func (s *Snapshot4) Snapshot5() *raftpb.Snapshot {
|
|||||||
log.Fatal("Couldn't re-marshal new snapshot")
|
log.Fatal("Couldn't re-marshal new snapshot")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nodes := s.GetNodesFromStore()
|
||||||
|
nodeList := make([]uint64, 0)
|
||||||
|
for _, v := range nodes {
|
||||||
|
nodeList = append(nodeList, v)
|
||||||
|
}
|
||||||
|
|
||||||
snap5 := raftpb.Snapshot{
|
snap5 := raftpb.Snapshot{
|
||||||
Data: newState,
|
Data: newState,
|
||||||
Index: s.LastIndex,
|
Index: s.LastIndex,
|
||||||
Term: s.LastTerm,
|
Term: s.LastTerm,
|
||||||
Nodes: make([]uint64, len(s.Peers)),
|
Nodes: nodeList,
|
||||||
}
|
|
||||||
|
|
||||||
for i, p := range s.Peers {
|
|
||||||
snap5.Nodes[i] = hashName(p.Name)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &snap5
|
return &snap5
|
||||||
|
Reference in New Issue
Block a user