Skip to content

Commit

Permalink
enhance: [cherry-pick] Reduce the frequency of index ralted logs (mil…
Browse files Browse the repository at this point in the history
…vus-io#33050) (milvus-io#34198)

issue:  milvus-io#33001


pr: milvus-io#33050 , milvus-io#33212 , milvus-io#33321

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
  • Loading branch information
xiaocai2333 committed Jun 27, 2024
1 parent 88766bb commit 42096a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions internal/datacoord/index_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (s *Server) completeIndexInfo(indexInfo *indexpb.IndexInfo, index *model.In
indexInfo.State = commonpb.IndexState_Finished
}

log.Info("completeIndexInfo success", zap.Int64("collectionID", index.CollectionID), zap.Int64("indexID", index.IndexID),
log.RatedInfo(60, "completeIndexInfo success", zap.Int64("collectionID", index.CollectionID), zap.Int64("indexID", index.IndexID),
zap.Int64("totalRows", indexInfo.TotalRows), zap.Int64("indexRows", indexInfo.IndexedRows),
zap.Int64("pendingIndexRows", indexInfo.PendingIndexRows),
zap.String("state", indexInfo.State.String()), zap.String("failReason", indexInfo.IndexStateFailReason))
Expand Down Expand Up @@ -678,11 +678,8 @@ func (s *Server) DescribeIndex(ctx context.Context, req *indexpb.DescribeIndexRe
log := log.Ctx(ctx).With(
zap.Int64("collectionID", req.GetCollectionID()),
zap.String("indexName", req.GetIndexName()),
)
log.Info("receive DescribeIndex request",
zap.Uint64("timestamp", req.GetTimestamp()),
)

if err := merr.CheckHealthy(s.GetStateCode()); err != nil {
log.Warn(msgDataCoordIsUnhealthy(paramtable.GetNodeID()), zap.Error(err))
return &indexpb.DescribeIndexResponse{
Expand All @@ -693,15 +690,15 @@ func (s *Server) DescribeIndex(ctx context.Context, req *indexpb.DescribeIndexRe
indexes := s.meta.indexMeta.GetIndexesForCollection(req.GetCollectionID(), req.GetIndexName())
if len(indexes) == 0 {
err := merr.WrapErrIndexNotFound(req.GetIndexName())
log.Warn("DescribeIndex fail", zap.Error(err))
log.RatedWarn(60, "DescribeIndex fail", zap.Error(err))
return &indexpb.DescribeIndexResponse{
Status: merr.Status(err),
}, nil
}

// The total rows of all indexes should be based on the current perspective
segments := s.selectSegmentIndexesStats(WithCollection(req.GetCollectionID()), SegmentFilterFunc(func(info *SegmentInfo) bool {
return (isFlush(info) || info.GetState() == commonpb.SegmentState_Dropped)
return isFlush(info) || info.GetState() == commonpb.SegmentState_Dropped
}))

indexInfos := make([]*indexpb.IndexInfo, 0)
Expand All @@ -727,7 +724,6 @@ func (s *Server) DescribeIndex(ctx context.Context, req *indexpb.DescribeIndexRe
s.completeIndexInfo(indexInfo, index, segments, false, createTs)
indexInfos = append(indexInfos, indexInfo)
}
log.Info("DescribeIndex success")
return &indexpb.DescribeIndexResponse{
Status: merr.Success(),
IndexInfos: indexInfos,
Expand Down
1 change: 0 additions & 1 deletion internal/proto/index_coord.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import "common.proto";
import "internal.proto";
import "milvus.proto";
import "schema.proto";
import "index_cgo_msg.proto";

service IndexCoord {
rpc GetComponentStates(milvus.GetComponentStatesRequest) returns (milvus.ComponentStates) {}
Expand Down

0 comments on commit 42096a2

Please sign in to comment.