Refine log of GetIndexBuildProgress (#13163)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/13185/head
dragondriver 2021-12-10 16:42:09 +08:00 committed by GitHub
parent 7ffabb6193
commit 8ad390c38a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 61 additions and 27 deletions

View File

@ -1601,6 +1601,11 @@ func (node *Proxy) GetIndexBuildProgress(ctx context.Context, request *milvuspb.
Status: unhealthyStatus(),
}, nil
}
sp, ctx := trace.StartSpanFromContextWithOperationName(ctx, "Proxy-GetIndexBuildProgress")
defer sp.Finish()
traceID, _, _ := trace.InfoFromSpan(sp)
gibpt := &getIndexBuildProgressTask{
ctx: ctx,
Condition: NewTaskCondition(ctx),
@ -1610,44 +1615,28 @@ func (node *Proxy) GetIndexBuildProgress(ctx context.Context, request *milvuspb.
dataCoord: node.dataCoord,
}
log.Debug("GetIndexBuildProgress enqueue",
zap.String("role", Params.RoleName),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName))
err := node.sched.ddQueue.Enqueue(gibpt)
if err != nil {
return &milvuspb.GetIndexBuildProgressResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
}
method := "GetIndexBuildProgress"
log.Debug("GetIndexBuildProgress",
log.Debug(
rpcReceived(method),
zap.String("traceID", traceID),
zap.String("role", Params.RoleName),
zap.Int64("msgID", request.Base.MsgID),
zap.Uint64("timestamp", request.Base.Timestamp),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName))
defer func() {
log.Debug("GetIndexBuildProgress Done",
if err := node.sched.ddQueue.Enqueue(gibpt); err != nil {
log.Warn(
rpcFailedToEnqueue(method),
zap.Error(err),
zap.String("traceID", traceID),
zap.String("role", Params.RoleName),
zap.Int64("msgID", request.Base.MsgID),
zap.Uint64("timestamp", request.Base.Timestamp),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName))
}()
err = gibpt.WaitToFinish()
if err != nil {
return &milvuspb.GetIndexBuildProgressResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UnexpectedError,
@ -1655,8 +1644,53 @@ func (node *Proxy) GetIndexBuildProgress(ctx context.Context, request *milvuspb.
},
}, nil
}
log.Debug("progress", zap.Any("result", gibpt.result))
log.Debug("progress", zap.Any("status", gibpt.result.Status))
log.Debug(
rpcEnqueued(method),
zap.String("traceID", traceID),
zap.String("role", Params.RoleName),
zap.Int64("MsgID", gibpt.ID()),
zap.Uint64("BeginTs", gibpt.BeginTs()),
zap.Uint64("EndTs", gibpt.EndTs()),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName))
if err := gibpt.WaitToFinish(); err != nil {
log.Warn(
rpcFailedToWaitToFinish(method),
zap.Error(err),
zap.String("traceID", traceID),
zap.String("role", Params.RoleName),
zap.Int64("MsgID", gibpt.ID()),
zap.Uint64("BeginTs", gibpt.BeginTs()),
zap.Uint64("EndTs", gibpt.EndTs()),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName))
return &milvuspb.GetIndexBuildProgressResponse{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_UnexpectedError,
Reason: err.Error(),
},
}, nil
}
log.Debug(
rpcDone(method),
zap.String("traceID", traceID),
zap.String("role", Params.RoleName),
zap.Int64("MsgID", gibpt.ID()),
zap.Uint64("BeginTs", gibpt.BeginTs()),
zap.Uint64("EndTs", gibpt.EndTs()),
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("field", request.FieldName),
zap.String("index name", request.IndexName),
zap.Any("result", gibpt.result))
return gibpt.result, nil
}