Print insert log once receive a request (#7318)

issue: #7316
Signed-off-by: sunby <bingyi.sun@zilliz.com>
pull/7331/head
sunby 2021-08-27 10:08:47 +08:00 committed by GitHub
parent 171f361ac5
commit 920b09cf7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 22 deletions

View File

@ -1171,28 +1171,7 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
chMgr: node.chMgr,
chTicker: node.chTicker,
}
if len(it.PartitionName) <= 0 {
it.PartitionName = Params.DefaultPartitionName
}
result := &milvuspb.MutationResult{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_Success,
},
}
err := node.sched.DmQueue.Enqueue(it)
if err != nil {
result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
result.Status.Reason = err.Error()
numRows := it.req.NumRows
errIndex := make([]uint32, numRows)
for i := uint32(0); i < numRows; i++ {
errIndex[i] = i
}
result.ErrIndex = errIndex
return result, nil
}
var err error
log.Debug("Insert",
zap.String("role", Params.RoleName),
@ -1203,6 +1182,7 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
zap.String("partition", request.PartitionName),
zap.Any("len(RowData)", len(it.RowData)),
zap.Any("len(RowIDs)", len(it.RowIDs)))
defer func() {
log.Debug("Insert Done",
zap.Error(err),
@ -1216,6 +1196,29 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
zap.Any("len(RowIDs)", len(it.RowIDs)))
}()
if len(it.PartitionName) <= 0 {
it.PartitionName = Params.DefaultPartitionName
}
result := &milvuspb.MutationResult{
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_Success,
},
}
err = node.sched.DmQueue.Enqueue(it)
if err != nil {
result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
result.Status.Reason = err.Error()
numRows := it.req.NumRows
errIndex := make([]uint32, numRows)
for i := uint32(0); i < numRows; i++ {
errIndex[i] = i
}
result.ErrIndex = errIndex
return result, nil
}
err = it.WaitToFinish()
if err != nil {
result.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError