[skip e2e]Fix datarace in proxy (#13607)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/13614/head
zhenshan.cao 2021-12-17 16:32:52 +08:00 committed by GitHub
parent 6c4e1e4008
commit bfdf6eb402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -1976,7 +1976,8 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
zap.String("partition", request.PartitionName),
zap.Int("len(FieldsData)", len(request.FieldsData)),
zap.Int("len(HashKeys)", len(request.HashKeys)),
zap.Uint32("NumRows", request.NumRows))
zap.Uint32("NumRows", request.NumRows),
zap.String("traceID", traceID))
if err := node.sched.dmQueue.Enqueue(it); err != nil {
log.Debug("Failed to enqueue insert task: " + err.Error())
@ -1991,8 +1992,6 @@ func (node *Proxy) Insert(ctx context.Context, request *milvuspb.InsertRequest)
zap.String("db", request.DbName),
zap.String("collection", request.CollectionName),
zap.String("partition", request.PartitionName),
zap.Int("len(FieldsData)", len(request.FieldsData)),
zap.Int("len(HashKeys)", len(request.HashKeys)),
zap.Uint32("NumRows", request.NumRows),
zap.String("traceID", traceID))

View File

@ -679,7 +679,6 @@ func (it *insertTask) checkFieldAutoIDAndHashPK() error {
// TODO(dragondriver): when we can ignore the order of input fields, use append directly
// it.req.FieldsData = append(it.req.FieldsData, &fieldData)
it.req.FieldsData = append(it.req.FieldsData, &schemapb.FieldData{})
copy(it.req.FieldsData[autoIDLoc+1:], it.req.FieldsData[autoIDLoc:])
it.req.FieldsData[autoIDLoc] = &fieldData