Skip to content

Commit

Permalink
enhance: Enhance segment log (milvus-io#36848)
Browse files Browse the repository at this point in the history
/kind improvement

Signed-off-by: bigsheeper <[email protected]>
  • Loading branch information
bigsheeper authored Oct 15, 2024
1 parent ba25320 commit f3b6792
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/datacoord/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions internal/querynodev2/segments/segment_l0.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/querynodev2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f3b6792

Please sign in to comment.