fix: save current target after target observer stop (#31315)

issue: #28491

should save target to meta store after target observer stop, incase of
target changed

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
wei liu 2024-03-18 12:27:04 +08:00 committed by GitHub
parent 69e1d612dc
commit 4dfdb1a443
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -459,11 +459,6 @@ func (s *Server) startServerLoop() {
}
func (s *Server) Stop() error {
// save target to meta store, after querycoord restart, make it fast to recover current target
if s.targetMgr != nil {
s.targetMgr.SaveCurrentTarget(s.store)
}
// FOLLOW the dependence graph:
// job scheduler -> checker controller -> task scheduler -> dist controller -> cluster -> session
// observers -> dist controller
@ -490,6 +485,13 @@ func (s *Server) Stop() error {
if s.targetObserver != nil {
s.targetObserver.Stop()
}
// save target to meta store, after querycoord restart, make it fast to recover current target
// should save target after target observer stop, incase of target changed
if s.targetMgr != nil {
s.targetMgr.SaveCurrentTarget(s.store)
}
if s.replicaObserver != nil {
s.replicaObserver.Stop()
}