diff --git a/internal/datacoord/server.go b/internal/datacoord/server.go index 608eb3bf14..1916ce76f9 100644 --- a/internal/datacoord/server.go +++ b/internal/datacoord/server.go @@ -528,6 +528,7 @@ func (s *Server) initServiceDiscovery() error { log.Warn("DataCoord failed to add datanode", zap.Error(err)) return err } + s.dnSessionWatcher = sessionutil.EmptySessionWatcher() } else { err := s.rewatchDataNodes(sessions) if err != nil { diff --git a/internal/util/sessionutil/session_util.go b/internal/util/sessionutil/session_util.go index 18197e0a1d..21f2c5554a 100644 --- a/internal/util/sessionutil/session_util.go +++ b/internal/util/sessionutil/session_util.go @@ -806,6 +806,20 @@ func (w *sessionWatcher) Stop() { w.wg.Wait() } +// EmptySessionWatcher returns a place holder for IndexNodeBinding mode datacoord +func EmptySessionWatcher() SessionWatcher { + return emptySessionWatcher{} +} + +// emptySessionWatcher is a place holder for IndexNodeBinding mode datacoord +type emptySessionWatcher struct{} + +func (emptySessionWatcher) EventChannel() <-chan *SessionEvent { + return nil +} + +func (emptySessionWatcher) Stop() {} + // WatchServices watches the service's up and down in etcd, and sends event to // eventChannel. // prefix is a parameter to know which service to watch and can be obtained in