mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 16:15:56 +00:00
make sure the holder has opened before merging NodeStatus
This commit is contained in:
parent
52897421ad
commit
17484fd73e
1 changed files with 12 additions and 1 deletions
13
server.go
13
server.go
|
|
@ -512,7 +512,18 @@ func (s *Server) HandleRemoteStatus(pb proto.Message) error {
|
|||
if s.Cluster.State != ClusterStateNormal {
|
||||
return nil
|
||||
}
|
||||
return s.mergeRemoteStatus(pb.(*internal.NodeStatus))
|
||||
|
||||
go func() {
|
||||
// Make sure the holder has opened.
|
||||
<-s.Holder.opened
|
||||
|
||||
err := s.mergeRemoteStatus(pb.(*internal.NodeStatus))
|
||||
if err != nil {
|
||||
s.Logger().Printf("merge remote status: %s", err)
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Server) mergeRemoteStatus(ns *internal.NodeStatus) error {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue