mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
enhance: Add ctx for load index logs (#29686)
This PR add ctx for load index logs Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
parent
3561586edf
commit
b45d08b47b
@ -891,6 +891,13 @@ func (s *LocalSegment) LoadIndex(ctx context.Context, indexInfo *querypb.FieldIn
|
||||
return err
|
||||
}
|
||||
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.Int64("collectionID", s.Collection()),
|
||||
zap.Int64("partitionID", s.Partition()),
|
||||
zap.Int64("segmentID", s.ID()),
|
||||
zap.Int64("fieldID", indexInfo.FieldID),
|
||||
)
|
||||
|
||||
err = loadIndexInfo.appendLoadIndexInfo(ctx, indexInfo, s.collectionID, s.partitionID, s.segmentID, fieldType)
|
||||
if err != nil {
|
||||
if loadIndexInfo.cleanLocalData(ctx) != nil {
|
||||
@ -909,7 +916,7 @@ func (s *LocalSegment) LoadIndex(ctx context.Context, indexInfo *querypb.FieldIn
|
||||
}
|
||||
|
||||
func (s *LocalSegment) LoadIndexInfo(ctx context.Context, indexInfo *querypb.FieldIndexInfo, info *LoadIndexInfo) error {
|
||||
log := log.With(
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.Int64("collectionID", s.Collection()),
|
||||
zap.Int64("partitionID", s.Partition()),
|
||||
zap.Int64("segmentID", s.ID()),
|
||||
@ -956,7 +963,7 @@ func (s *LocalSegment) UpdateFieldRawDataSize(ctx context.Context, numRows int64
|
||||
return err
|
||||
}
|
||||
|
||||
log.Info("updateFieldRawDataSize done", zap.Int64("segmentID", s.ID()))
|
||||
log.Ctx(ctx).Info("updateFieldRawDataSize done", zap.Int64("segmentID", s.ID()))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -680,6 +680,13 @@ func (loader *segmentLoader) loadFieldsIndex(ctx context.Context,
|
||||
numRows int64,
|
||||
indexedFieldInfos map[int64]*IndexedFieldInfo,
|
||||
) error {
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.Int64("collectionID", segment.Collection()),
|
||||
zap.Int64("partitionID", segment.Partition()),
|
||||
zap.Int64("segmentID", segment.ID()),
|
||||
zap.Int64("rowCount", numRows),
|
||||
)
|
||||
|
||||
for fieldID, fieldInfo := range indexedFieldInfos {
|
||||
indexInfo := fieldInfo.IndexInfo
|
||||
err := loader.loadFieldIndex(ctx, segment, indexInfo)
|
||||
@ -688,8 +695,6 @@ func (loader *segmentLoader) loadFieldsIndex(ctx context.Context,
|
||||
}
|
||||
|
||||
log.Info("load field binlogs done for sealed segment with index",
|
||||
zap.Int64("collection", segment.collectionID),
|
||||
zap.Int64("segment", segment.segmentID),
|
||||
zap.Int64("fieldID", fieldID),
|
||||
zap.Any("binlog", fieldInfo.FieldBinlog.Binlogs),
|
||||
zap.Int32("current_index_version", fieldInfo.IndexInfo.GetCurrentIndexVersion()),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user