init candidate servers when setting a starting snapshot
This commit is contained in:
@@ -79,6 +79,10 @@ func (r *LockRing) SetSnapshot(servers []pb.ServerAddress) {
|
|||||||
|
|
||||||
r.Lock()
|
r.Lock()
|
||||||
r.lastUpdateTime = time.Now()
|
r.lastUpdateTime = time.Now()
|
||||||
|
// init candidateServers
|
||||||
|
for _, server := range servers {
|
||||||
|
r.candidateServers[server] = struct{}{}
|
||||||
|
}
|
||||||
r.Unlock()
|
r.Unlock()
|
||||||
|
|
||||||
r.addOneSnapshot(servers)
|
r.addOneSnapshot(servers)
|
||||||
|
|||||||
Reference in New Issue
Block a user