From 658d302aa4ecd43e1463f9ff54bdc0f29954b7d3 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 5 May 2024 14:16:26 -0700 Subject: [PATCH] init candidate servers when setting a starting snapshot --- weed/cluster/lock_manager/lock_ring.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/cluster/lock_manager/lock_ring.go b/weed/cluster/lock_manager/lock_ring.go index 808f559ee..e7f60e6d2 100644 --- a/weed/cluster/lock_manager/lock_ring.go +++ b/weed/cluster/lock_manager/lock_ring.go @@ -79,6 +79,10 @@ func (r *LockRing) SetSnapshot(servers []pb.ServerAddress) { r.Lock() r.lastUpdateTime = time.Now() + // init candidateServers + for _, server := range servers { + r.candidateServers[server] = struct{}{} + } r.Unlock() r.addOneSnapshot(servers)