Browse Source

refactor

pull/3122/head
chrislu 3 years ago
parent
commit
c59068d0f3
  1. 4
      weed/filer/filer.go
  2. 4
      weed/server/filer_server.go

4
weed/filer/filer.go

@ -68,12 +68,12 @@ func NewFiler(masters map[string]pb.ServerAddress, grpcDialOption grpc.DialOptio
return f
}
func (f *Filer) AggregateFromPeers(self pb.ServerAddress) {
func (f *Filer) AggregateFromPeers(self pb.ServerAddress, existingNodes []*master_pb.ClusterNodeUpdate) {
f.MetaAggregator = NewMetaAggregator(f, self, f.GrpcDialOption)
f.MasterClient.OnPeerUpdate = f.MetaAggregator.OnPeerUpdate
for _, peerUpdate := range f.ListExistingPeerUpdates() {
for _, peerUpdate := range existingNodes {
f.MetaAggregator.OnPeerUpdate(peerUpdate)
}

4
weed/server/filer_server.go

@ -164,7 +164,9 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
readonlyMux.HandleFunc("/", fs.readonlyFilerHandler)
}
fs.filer.AggregateFromPeers(option.Host)
existingNodes := fs.filer.ListExistingPeerUpdates()
fs.filer.AggregateFromPeers(option.Host, existingNodes)
fs.filer.LoadBuckets()

Loading…
Cancel
Save