mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
enhance: Tidy build index logs (#46531)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
This commit is contained in:
parent
65cca5d046
commit
52a05831b5
@ -221,8 +221,11 @@ func (it *indexBuildTask) PreExecute(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (it *indexBuildTask) Execute(ctx context.Context) error {
|
||||
log := log.Ctx(ctx).With(zap.String("clusterID", it.req.GetClusterID()), zap.Int64("buildID", it.req.GetBuildID()),
|
||||
zap.Int64("collection", it.req.GetCollectionID()), zap.Int64("segmentID", it.req.GetSegmentID()),
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.String("clusterID", it.req.GetClusterID()),
|
||||
zap.Int64("buildID", it.req.GetBuildID()),
|
||||
zap.Int64("collection", it.req.GetCollectionID()),
|
||||
zap.Int64("segmentID", it.req.GetSegmentID()),
|
||||
zap.Int32("currentIndexVersion", it.req.GetCurrentIndexVersion()))
|
||||
|
||||
indexType := it.newIndexParams[common.IndexTypeKey]
|
||||
@ -298,11 +301,6 @@ func (it *indexBuildTask) Execute(ctx context.Context) error {
|
||||
LackBinlogRows: it.req.GetLackBinlogRows(),
|
||||
StorageVersion: it.req.GetStorageVersion(),
|
||||
}
|
||||
|
||||
if it.pluginContext != nil {
|
||||
buildIndexParams.StoragePluginContext = it.pluginContext
|
||||
}
|
||||
|
||||
if buildIndexParams.StorageVersion == storage.StorageV2 {
|
||||
buildIndexParams.SegmentInsertFiles = util.GetSegmentInsertFiles(
|
||||
it.req.GetInsertLogs(),
|
||||
@ -314,6 +312,11 @@ func (it *indexBuildTask) Execute(ctx context.Context) error {
|
||||
}
|
||||
log.Info("create index", zap.Any("buildIndexParams", buildIndexParams))
|
||||
|
||||
// set plugin context after logging the indexParams to avoid logging sensitive data
|
||||
if it.pluginContext != nil {
|
||||
buildIndexParams.StoragePluginContext = it.pluginContext
|
||||
}
|
||||
|
||||
it.index, err = indexcgowrapper.CreateIndex(ctx, buildIndexParams)
|
||||
if err != nil {
|
||||
if it.index != nil && it.index.CleanLocalData() != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user