From 5fac2fa1d2bfda42537d31c64b8b0390fe66799a Mon Sep 17 00:00:00 2001 From: wayblink Date: Wed, 19 Jun 2024 11:16:00 +0800 Subject: [PATCH] fix: Panic if ProcessActiveStandBy returns error (#33369) #33368 Signed-off-by: wayblink --- internal/datacoord/server.go | 4 ++-- internal/querycoordv2/server.go | 2 +- internal/rootcoord/root_coord.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/datacoord/server.go b/internal/datacoord/server.go index 97a129ec31..9eb87923f8 100644 --- a/internal/datacoord/server.go +++ b/internal/datacoord/server.go @@ -276,13 +276,13 @@ func (s *Server) Register() error { err := s.session.ProcessActiveStandBy(s.activateFunc) if err != nil { log.Error("failed to activate standby datacoord server", zap.Error(err)) - return + panic(err) } err = s.icSession.ForceActiveStandby(nil) if err != nil { log.Error("failed to force activate standby indexcoord server", zap.Error(err)) - return + panic(err) } afterRegister() }() diff --git a/internal/querycoordv2/server.go b/internal/querycoordv2/server.go index da16b65fb4..6ac6f9a6df 100644 --- a/internal/querycoordv2/server.go +++ b/internal/querycoordv2/server.go @@ -160,7 +160,7 @@ func (s *Server) Register() error { go func() { if err := s.session.ProcessActiveStandBy(s.activateFunc); err != nil { log.Error("failed to activate standby server", zap.Error(err)) - return + panic(err) } afterRegister() }() diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 4e8fc35ee1..2f40efa440 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -280,7 +280,7 @@ func (c *Core) Register() error { go func() { if err := c.session.ProcessActiveStandBy(c.activateFunc); err != nil { log.Warn("failed to activate standby rootcoord server", zap.Error(err)) - return + panic(err) } afterRegister() }()