mirror of https://github.com/milvus-io/milvus.git
Refine log of HasCollection (#12523)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/12539/head
parent
e2f9eacd5c
commit
6bfb4f8196
|
@ -313,6 +313,17 @@ func (node *Proxy) HasCollection(ctx context.Context, request *milvuspb.HasColle
|
||||||
Status: unhealthyStatus(),
|
Status: unhealthyStatus(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sp, ctx := trace.StartSpanFromContextWithOperationName(ctx, "Proxy-HasCollection")
|
||||||
|
defer sp.Finish()
|
||||||
|
traceID, _, _ := trace.InfoFromSpan(sp)
|
||||||
|
|
||||||
|
log.Debug("HasCollection received",
|
||||||
|
zap.String("traceID", traceID),
|
||||||
|
zap.String("role", Params.RoleName),
|
||||||
|
zap.String("db", request.DbName),
|
||||||
|
zap.String("collection", request.CollectionName))
|
||||||
|
|
||||||
hct := &hasCollectionTask{
|
hct := &hasCollectionTask{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
Condition: NewTaskCondition(ctx),
|
Condition: NewTaskCondition(ctx),
|
||||||
|
@ -320,38 +331,14 @@ func (node *Proxy) HasCollection(ctx context.Context, request *milvuspb.HasColle
|
||||||
rootCoord: node.rootCoord,
|
rootCoord: node.rootCoord,
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debug("HasCollection enqueue",
|
if err := node.sched.ddQueue.Enqueue(hct); err != nil {
|
||||||
zap.String("role", Params.RoleName),
|
log.Warn("HasCollection failed to enqueue",
|
||||||
zap.String("db", request.DbName),
|
|
||||||
zap.String("collection", request.CollectionName))
|
|
||||||
err := node.sched.ddQueue.Enqueue(hct)
|
|
||||||
if err != nil {
|
|
||||||
return &milvuspb.BoolResponse{
|
|
||||||
Status: &commonpb.Status{
|
|
||||||
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
|
||||||
Reason: err.Error(),
|
|
||||||
},
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Debug("HasCollection",
|
|
||||||
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))
|
|
||||||
defer func() {
|
|
||||||
log.Debug("HasCollection Done",
|
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
|
zap.String("traceID", traceID),
|
||||||
zap.String("role", Params.RoleName),
|
zap.String("role", Params.RoleName),
|
||||||
zap.Int64("msgID", request.Base.MsgID),
|
|
||||||
zap.Uint64("timestamp", request.Base.Timestamp),
|
|
||||||
zap.String("db", request.DbName),
|
zap.String("db", request.DbName),
|
||||||
zap.String("collection", request.CollectionName))
|
zap.String("collection", request.CollectionName))
|
||||||
}()
|
|
||||||
|
|
||||||
err = hct.WaitToFinish()
|
|
||||||
if err != nil {
|
|
||||||
return &milvuspb.BoolResponse{
|
return &milvuspb.BoolResponse{
|
||||||
Status: &commonpb.Status{
|
Status: &commonpb.Status{
|
||||||
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
||||||
|
@ -360,6 +347,43 @@ func (node *Proxy) HasCollection(ctx context.Context, request *milvuspb.HasColle
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Debug("HasCollection enqueued",
|
||||||
|
zap.String("traceID", traceID),
|
||||||
|
zap.String("role", Params.RoleName),
|
||||||
|
zap.Int64("MsgID", hct.ID()),
|
||||||
|
zap.Uint64("BeginTS", hct.BeginTs()),
|
||||||
|
zap.Uint64("EndTS", hct.EndTs()),
|
||||||
|
zap.String("db", request.DbName),
|
||||||
|
zap.String("collection", request.CollectionName))
|
||||||
|
|
||||||
|
if err := hct.WaitToFinish(); err != nil {
|
||||||
|
log.Warn("HasCollection failed to WaitToFinish",
|
||||||
|
zap.Error(err),
|
||||||
|
zap.String("traceID", traceID),
|
||||||
|
zap.String("role", Params.RoleName),
|
||||||
|
zap.Int64("MsgID", hct.ID()),
|
||||||
|
zap.Uint64("BeginTS", hct.BeginTs()),
|
||||||
|
zap.Uint64("EndTS", hct.EndTs()),
|
||||||
|
zap.String("db", request.DbName),
|
||||||
|
zap.String("collection", request.CollectionName))
|
||||||
|
|
||||||
|
return &milvuspb.BoolResponse{
|
||||||
|
Status: &commonpb.Status{
|
||||||
|
ErrorCode: commonpb.ErrorCode_UnexpectedError,
|
||||||
|
Reason: err.Error(),
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Debug("HasCollection done",
|
||||||
|
zap.String("traceID", traceID),
|
||||||
|
zap.String("role", Params.RoleName),
|
||||||
|
zap.Int64("MsgID", hct.ID()),
|
||||||
|
zap.Uint64("BeginTS", hct.BeginTs()),
|
||||||
|
zap.Uint64("EndTS", hct.EndTs()),
|
||||||
|
zap.String("db", request.DbName),
|
||||||
|
zap.String("collection", request.CollectionName))
|
||||||
|
|
||||||
return hct.result, nil
|
return hct.result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue