enhance: Refine frequent log in datacoord (#33449)

This PR changes:
- Frequent `ListIndexes` success log to debug level
- Aggregate collection missing log after collection dropped in
`meta.GetCollectionIndexFilesSize`

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/33458/head
congqixia 2024-05-29 19:15:43 +08:00 committed by GitHub
parent 08b94ea81d
commit 54797b4286
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -917,7 +917,7 @@ func (s *Server) ListIndexes(ctx context.Context, req *indexpb.ListIndexesReques
UserIndexParams: index.UserIndexParams, UserIndexParams: index.UserIndexParams,
} }
}) })
log.Info("List index success") log.Debug("List index success")
return &indexpb.ListIndexesResponse{ return &indexpb.ListIndexesResponse{
Status: merr.Success(), Status: merr.Success(),
IndexInfos: indexInfos, IndexInfos: indexInfos,

View File

@ -47,6 +47,7 @@ import (
"github.com/milvus-io/milvus/pkg/util/paramtable" "github.com/milvus-io/milvus/pkg/util/paramtable"
"github.com/milvus-io/milvus/pkg/util/timerecord" "github.com/milvus-io/milvus/pkg/util/timerecord"
"github.com/milvus-io/milvus/pkg/util/tsoutil" "github.com/milvus-io/milvus/pkg/util/tsoutil"
"github.com/milvus-io/milvus/pkg/util/typeutil"
) )
type meta struct { type meta struct {
@ -363,6 +364,8 @@ func (m *meta) GetCollectionIndexFilesSize() uint64 {
m.RLock() m.RLock()
defer m.RUnlock() defer m.RUnlock()
var total uint64 var total uint64
missingCollections := make(typeutil.Set[int64])
for _, segmentIdx := range m.indexMeta.GetAllSegIndexes() { for _, segmentIdx := range m.indexMeta.GetAllSegIndexes() {
coll, ok := m.collections[segmentIdx.CollectionID] coll, ok := m.collections[segmentIdx.CollectionID]
if ok { if ok {
@ -370,9 +373,12 @@ func (m *meta) GetCollectionIndexFilesSize() uint64 {
fmt.Sprint(segmentIdx.CollectionID), fmt.Sprint(segmentIdx.SegmentID)).Set(float64(segmentIdx.IndexSize)) fmt.Sprint(segmentIdx.CollectionID), fmt.Sprint(segmentIdx.SegmentID)).Set(float64(segmentIdx.IndexSize))
total += segmentIdx.IndexSize total += segmentIdx.IndexSize
} else { } else {
log.Warn("not found database name", zap.Int64("collectionID", segmentIdx.CollectionID)) missingCollections.Insert(segmentIdx.CollectionID)
} }
} }
if missingCollections.Len() > 0 {
log.Warn("collection info not found when calculating index file sizes", zap.Int64s("collectionIDs", missingCollections.Collect()))
}
return total return total
} }