From 920b09cf7dc533c380c1b81adb4c65fded214cd6 Mon Sep 17 00:00:00 2001 From: sunby Date: Fri, 27 Aug 2021 10:08:47 +0800 Subject: [PATCH] Print insert log once receive a request (#7318) issue: #7316 Signed-off-by: sunby --- internal/proxy/impl.go | 47 ++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index defe006ddb..29c5a7ed1f 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -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