enhance: Enhance segment log (#36848)

/kind improvement

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
yihao.dai 2024-10-15 20:43:30 +08:00 committed by GitHub
parent ba25320aea
commit f3b6792a25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -489,7 +489,7 @@ func (m *meta) GetAllCollectionNumRows() map[int64]int64 {
// AddSegment records segment info, persisting info into kv store
func (m *meta) AddSegment(ctx context.Context, segment *SegmentInfo) error {
log := log.Ctx(ctx)
log := log.Ctx(ctx).With(zap.String("channel", segment.GetInsertChannel()))
log.Info("meta update: adding segment - Start", zap.Int64("segmentID", segment.GetID()))
m.Lock()
defer m.Unlock()

View File

@ -173,6 +173,13 @@ func (s *L0Segment) Release(ctx context.Context, opts ...releaseOption) {
s.pks = nil
s.tss = nil
log.Ctx(ctx).Info("release L0 segment from memory",
zap.Int64("collectionID", s.Collection()),
zap.Int64("partitionID", s.Partition()),
zap.Int64("segmentID", s.ID()),
zap.String("segmentType", s.segmentType.String()),
)
}
func (s *L0Segment) RemoveUnusedFieldFiles() error {

View File

@ -410,7 +410,7 @@ func (node *QueryNode) LoadSegments(ctx context.Context, req *querypb.LoadSegmen
zap.Int64("segmentID", segment.GetSegmentID()),
zap.String("level", segment.GetLevel().String()),
zap.Int64("currentNodeID", node.GetNodeID()),
zap.Bool("isSorted", segment.GetIsSorted()),
zap.Int64("dstNodeID", req.GetDstNodeID()),
)
log.Info("received load segments request",