From 06471dac9d2b2b3c82748d4525168f25a87896f0 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 25 Jun 2023 15:28:16 -0700 Subject: [PATCH] init lock ring --- weed/filer/filer.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weed/filer/filer.go b/weed/filer/filer.go index 0d5cad47b..7625d4bde 100644 --- a/weed/filer/filer.go +++ b/weed/filer/filer.go @@ -112,6 +112,14 @@ func (f *Filer) MaybeBootstrapFromPeers(self pb.ServerAddress, existingNodes []* func (f *Filer) AggregateFromPeers(self pb.ServerAddress, existingNodes []*master_pb.ClusterNodeUpdate, startFrom time.Time) { + var snapshot []pb.ServerAddress + for _, node := range existingNodes { + address := pb.ServerAddress(node.Address) + snapshot = append(snapshot, address) + } + f.Dlm.LockRing.SetSnapshot(snapshot) + glog.V(0).Infof("%s aggregate from peers %+v", self, snapshot) + f.MetaAggregator = NewMetaAggregator(f, self, f.GrpcDialOption) f.MasterClient.SetOnPeerUpdateFn(func(update *master_pb.ClusterNodeUpdate, startFrom time.Time) { if update.NodeType != cluster.FilerType {