This commit is contained in:
chrislu 2022-05-30 16:28:36 -07:00
parent 682382648e
commit c59068d0f3
2 changed files with 5 additions and 3 deletions

View file

@ -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)
}

View file

@ -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()