quick fix queryCoordV2 active-standby (#21501)

Signed-off-by: wayblink <anyang.wang@zilliz.com>
pull/21533/head
wayblink 2023-01-05 10:09:34 +08:00 committed by GitHub
parent 9a571c5d6a
commit c6b200689d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 17 deletions

View File

@ -321,6 +321,25 @@ func (s *Server) Start() error {
return err
}
if s.enableActiveStandBy {
s.activateFunc = func() {
log.Info("querycoord switch from standby to active, activating")
s.startServerLoop()
s.UpdateStateCode(commonpb.StateCode_Healthy)
}
s.UpdateStateCode(commonpb.StateCode_StandBy)
} else {
s.startServerLoop()
s.UpdateStateCode(commonpb.StateCode_Healthy)
}
log.Info("QueryCoord started")
s.afterStart()
return nil
}
func (s *Server) startServerLoop() {
log.Info("start cluster...")
s.cluster.Start(s.ctx)
@ -337,23 +356,6 @@ func (s *Server) Start() error {
s.collectionObserver.Start(s.ctx)
s.leaderObserver.Start(s.ctx)
s.targetObserver.Start(s.ctx)
if s.enableActiveStandBy {
s.activateFunc = func() {
// todo to complete
log.Info("querycoord switch from standby to active, activating")
s.initMeta()
s.UpdateStateCode(commonpb.StateCode_Healthy)
}
s.UpdateStateCode(commonpb.StateCode_StandBy)
} else {
s.UpdateStateCode(commonpb.StateCode_Healthy)
}
log.Info("QueryCoord started")
s.afterStart()
return nil
}
func (s *Server) Stop() error {