From 1408926cd9fdb9851538b4a48e22b28dac705f8e Mon Sep 17 00:00:00 2001 From: Xiaofan <83447078+xiaofan-luan@users.noreply.github.com> Date: Wed, 29 Dec 2021 10:06:47 +0800 Subject: [PATCH] Remove logs without enough info (#14440) Signed-off-by: xiaofan-luan --- internal/datacoord/compaction_trigger.go | 5 +++-- internal/indexcoord/index_coord.go | 1 - internal/indexcoord/meta_table.go | 5 ----- internal/indexnode/indexnode.go | 5 ----- internal/querynode/impl.go | 8 -------- internal/rootcoord/root_coord.go | 3 --- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/internal/datacoord/compaction_trigger.go b/internal/datacoord/compaction_trigger.go index ca90a17272..68b3e1cc14 100644 --- a/internal/datacoord/compaction_trigger.go +++ b/internal/datacoord/compaction_trigger.go @@ -255,8 +255,9 @@ func (t *compactionTrigger) handleGlobalSignal(signal *compactionSignal) { if len(mergeCompactionPlans) != 0 { log.Debug("global merge compaction plans", zap.Int64("signalID", signal.id), zap.Int64s("plans", getPlanIDs(mergeCompactionPlans))) } - - log.Info("handle global compaction cost", zap.Int64("milliseconds", time.Since(t1).Milliseconds())) + if time.Since(t1).Milliseconds() > 500 { + log.Info("handle global compaction cost too long", zap.Int64("milliseconds", time.Since(t1).Milliseconds())) + } } func (t *compactionTrigger) handleSignal(signal *compactionSignal) { diff --git a/internal/indexcoord/index_coord.go b/internal/indexcoord/index_coord.go index 7343898cb9..0578b0c11c 100644 --- a/internal/indexcoord/index_coord.go +++ b/internal/indexcoord/index_coord.go @@ -698,7 +698,6 @@ func (i *IndexCoord) recycleUnusedIndexFiles() { return case <-timeTicker.C: metas := i.metaTable.GetUnusedIndexFiles(i.taskLimit) - log.Debug("IndexCoord recycleUnusedIndexFiles", zap.Int("Need recycle tasks num", len(metas))) for _, meta := range metas { if meta.indexMeta.MarkDeleted { unusedIndexFilePathPrefix := Params.IndexCoordCfg.IndexStorageRootPath + "/" + strconv.Itoa(int(meta.indexMeta.IndexBuildID)) diff --git a/internal/indexcoord/meta_table.go b/internal/indexcoord/meta_table.go index 17f52a0758..457a3ef9f9 100644 --- a/internal/indexcoord/meta_table.go +++ b/internal/indexcoord/meta_table.go @@ -401,8 +401,6 @@ func (mt *metaTable) GetUnusedIndexFiles(limit int) []Meta { func (mt *metaTable) GetUnassignedTasks(onlineNodeIDs []int64) []Meta { mt.lock.RLock() defer mt.lock.RUnlock() - - log.Debug("IndexCoord get unassigned tasks", zap.Int64s("online nodes", onlineNodeIDs)) var metas []Meta for _, meta := range mt.indexBuildID2Meta { @@ -425,9 +423,6 @@ func (mt *metaTable) GetUnassignedTasks(onlineNodeIDs []int64) []Meta { metas = append(metas, Meta{indexMeta: proto.Clone(meta.indexMeta).(*indexpb.IndexMeta), revision: meta.revision}) } } - - log.Debug("IndexCoord get unassigned tasks finished", zap.Int("tasks num", len(metas))) - return metas } diff --git a/internal/indexnode/indexnode.go b/internal/indexnode/indexnode.go index ff836750a2..f9bf63c9ed 100644 --- a/internal/indexnode/indexnode.go +++ b/internal/indexnode/indexnode.go @@ -359,10 +359,6 @@ func (i *IndexNode) GetStatisticsChannel(ctx context.Context) (*milvuspb.StringR // GetMetrics gets the metrics info of IndexNode. // TODO(dragondriver): cache the Metrics and set a retention to the cache func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) { - log.Debug("IndexNode.GetMetrics", - zap.Int64("node_id", Params.IndexNodeCfg.NodeID), - zap.String("req", req.Request)) - if !i.isHealthy() { log.Warn("IndexNode.GetMetrics failed", zap.Int64("node_id", Params.IndexNodeCfg.NodeID), @@ -401,7 +397,6 @@ func (i *IndexNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequ zap.Int64("node_id", Params.IndexNodeCfg.NodeID), zap.String("req", req.Request), zap.String("metric_type", metricType), - zap.Any("metrics", metrics), // TODO(dragondriver): necessary? may be very large zap.Error(err)) return metrics, nil diff --git a/internal/querynode/impl.go b/internal/querynode/impl.go index 60e88da450..df9bfcadcd 100644 --- a/internal/querynode/impl.go +++ b/internal/querynode/impl.go @@ -527,10 +527,6 @@ func (node *QueryNode) isHealthy() bool { // GetMetrics return system infos of the query node, such as total memory, memory usage, cpu usage ... // TODO(dragondriver): cache the Metrics and set a retention to the cache func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) { - log.Debug("QueryNode.GetMetrics", - zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID), - zap.String("req", req.Request)) - if !node.isHealthy() { log.Warn("QueryNode.GetMetrics failed", zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID), @@ -562,9 +558,6 @@ func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsR }, nil } - log.Debug("QueryNode.GetMetrics", - zap.String("metric_type", metricType)) - if metricType == metricsinfo.SystemInfoMetrics { metrics, err := getSystemInfoMetrics(ctx, req, node) @@ -572,7 +565,6 @@ func (node *QueryNode) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsR zap.Int64("node_id", Params.QueryNodeCfg.QueryNodeID), zap.String("req", req.Request), zap.String("metric_type", metricType), - zap.Any("metrics", metrics), // TODO(dragondriver): necessary? may be very large zap.Error(err)) return metrics, nil diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 9240d0b2ba..d1a7384bfd 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -1805,9 +1805,6 @@ func (c *Core) AllocID(ctx context.Context, in *rootcoordpb.AllocIDRequest) (*ro Count: in.Count, }, nil } - log.Debug("AllocID success", zap.String("role", typeutil.RootCoordRole), - zap.Int64("id start", start), zap.Uint32("count", in.Count), zap.Int64("msgID", in.Base.MsgID)) - return &rootcoordpb.AllocIDResponse{ Status: succStatus(), ID: start,