mirror of https://github.com/milvus-io/milvus.git
Refine log of GetIndexState (#13164)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/13190/head
parent
3077b30362
commit
f107f9d03e
|
@ -1809,6 +1809,11 @@ func (node *Proxy) GetIndexState(ctx context.Context, request *milvuspb.GetIndex
|
|||
Status: unhealthyStatus(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
sp, ctx := trace.StartSpanFromContextWithOperationName(ctx, "Proxy-Insert")
|
||||
defer sp.Finish()
|
||||
traceID, _, _ := trace.InfoFromSpan(sp)
|
||||
|
||||
dipt := &getIndexStateTask{
|
||||
ctx: ctx,
|
||||
Condition: NewTaskCondition(ctx),
|
||||
|
@ -1817,44 +1822,28 @@ func (node *Proxy) GetIndexState(ctx context.Context, request *milvuspb.GetIndex
|
|||
rootCoord: node.rootCoord,
|
||||
}
|
||||
|
||||
log.Debug("GetIndexState 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(dipt)
|
||||
if err != nil {
|
||||
return &milvuspb.GetIndexStateResponse{
|
||||
Status: &commonpb.Status{
|
||||
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
||||
Reason: err.Error(),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
method := "GetIndexState"
|
||||
|
||||
log.Debug("GetIndexState",
|
||||
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("GetIndexState Done",
|
||||
|
||||
if err := node.sched.ddQueue.Enqueue(dipt); 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 = dipt.WaitToFinish()
|
||||
if err != nil {
|
||||
return &milvuspb.GetIndexStateResponse{
|
||||
Status: &commonpb.Status{
|
||||
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
||||
|
@ -1863,6 +1852,52 @@ func (node *Proxy) GetIndexState(ctx context.Context, request *milvuspb.GetIndex
|
|||
}, nil
|
||||
}
|
||||
|
||||
log.Debug(
|
||||
rpcEnqueued(method),
|
||||
zap.String("traceID", traceID),
|
||||
zap.String("role", Params.RoleName),
|
||||
zap.Int64("MsgID", dipt.ID()),
|
||||
zap.Uint64("BeginTs", dipt.BeginTs()),
|
||||
zap.Uint64("EndTs", dipt.EndTs()),
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
zap.String("field", request.FieldName),
|
||||
zap.String("index name", request.IndexName))
|
||||
|
||||
if err := dipt.WaitToFinish(); err != nil {
|
||||
log.Warn(
|
||||
rpcFailedToWaitToFinish(method),
|
||||
zap.Error(err),
|
||||
zap.String("traceID", traceID),
|
||||
zap.String("role", Params.RoleName),
|
||||
zap.Int64("MsgID", dipt.ID()),
|
||||
zap.Uint64("BeginTs", dipt.BeginTs()),
|
||||
zap.Uint64("EndTs", dipt.EndTs()),
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
zap.String("field", request.FieldName),
|
||||
zap.String("index name", request.IndexName))
|
||||
|
||||
return &milvuspb.GetIndexStateResponse{
|
||||
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", dipt.ID()),
|
||||
zap.Uint64("BeginTs", dipt.BeginTs()),
|
||||
zap.Uint64("EndTs", dipt.EndTs()),
|
||||
zap.String("db", request.DbName),
|
||||
zap.String("collection", request.CollectionName),
|
||||
zap.String("field", request.FieldName),
|
||||
zap.String("index name", request.IndexName))
|
||||
|
||||
return dipt.result, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue