From b0f268e08755976da178f72d36ed5ab4a7012744 Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Tue, 16 Nov 2021 19:21:49 +0800 Subject: [PATCH] Add more debug log for proxy registry in rootcoord (#11899) Signed-off-by: yudong.cai --- internal/rootcoord/proxy_manager.go | 4 ++-- internal/rootcoord/timeticksync.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/rootcoord/proxy_manager.go b/internal/rootcoord/proxy_manager.go index 83eb7ef1b1..46989b4d9c 100644 --- a/internal/rootcoord/proxy_manager.go +++ b/internal/rootcoord/proxy_manager.go @@ -101,8 +101,6 @@ func (p *proxyManager) WatchProxy() error { } for _, s := range sessions { metrics.RootCoordProxyLister.WithLabelValues(metricProxy(s.ServerID)).Set(1) - } - for _, s := range sessions { log.Debug("Get proxy", zap.Int64("id", s.ServerID), zap.String("addr", s.Address), zap.String("name", s.ServerName)) } @@ -140,6 +138,7 @@ func (p *proxyManager) WatchProxy() error { } } p.lock.Lock() + log.Debug("watchProxy detect PUT event", zap.Int64("serverID", sess.ServerID)) for _, f := range p.addSessions { f(sess) } @@ -153,6 +152,7 @@ func (p *proxyManager) WatchProxy() error { continue } p.lock.Lock() + log.Debug("watchProxy detect DELETE event", zap.Int64("serverID", sess.ServerID)) for _, f := range p.delSessions { f(sess) } diff --git a/internal/rootcoord/timeticksync.go b/internal/rootcoord/timeticksync.go index 7da158c40c..e5b827dd20 100644 --- a/internal/rootcoord/timeticksync.go +++ b/internal/rootcoord/timeticksync.go @@ -197,6 +197,7 @@ func (t *timetickSync) AddProxy(sess *sessionutil.Session) { t.lock.Lock() defer t.lock.Unlock() t.proxyTimeTick[sess.ServerID] = nil + log.Debug("Add proxy for timeticksync", zap.Int64("serverID", sess.ServerID)) } func (t *timetickSync) DelProxy(sess *sessionutil.Session) { @@ -204,6 +205,7 @@ func (t *timetickSync) DelProxy(sess *sessionutil.Session) { defer t.lock.Unlock() if _, ok := t.proxyTimeTick[sess.ServerID]; ok { delete(t.proxyTimeTick, sess.ServerID) + log.Debug("Remove proxy from timeticksync", zap.Int64("serverID", sess.ServerID)) t.sendToChannel() } }