mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fix migration to allow snapshots to have the right IDs
This commit is contained in:
parent
2d5ccf12ef
commit
ce82a3e7ad
@ -171,15 +171,17 @@ func (s *Snapshot4) Snapshot5() *raftpb.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{
|
||||
Data: newState,
|
||||
Index: s.LastIndex,
|
||||
Term: s.LastTerm,
|
||||
Nodes: make([]uint64, len(s.Peers)),
|
||||
}
|
||||
|
||||
for i, p := range s.Peers {
|
||||
snap5.Nodes[i] = hashName(p.Name)
|
||||
Nodes: nodeList,
|
||||
}
|
||||
|
||||
return &snap5
|
||||
|
Loading…
x
Reference in New Issue
Block a user