Fix insert failed to return correct id range

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/4973/head^2
zhenshan.cao 2020-11-30 12:08:47 +08:00 committed by yefu.chen
parent d88a654db8
commit 24942c3d6d
1 changed files with 5 additions and 1 deletions

View File

@ -99,9 +99,11 @@ func (it *InsertTask) Execute() error {
return err
}
autoID := description.Schema.AutoID
var rowIDBegin UniqueID
var rowIDEnd UniqueID
if autoID || true {
rowNums := len(it.BaseInsertTask.RowData)
rowIDBegin, rowIDEnd, _ := it.rowIDAllocator.Alloc(uint32(rowNums))
rowIDBegin, rowIDEnd, _ = it.rowIDAllocator.Alloc(uint32(rowNums))
it.BaseInsertTask.RowIDs = make([]UniqueID, rowNums)
for i := rowIDBegin; i < rowIDEnd; i++ {
offset := i - rowIDBegin
@ -121,6 +123,8 @@ func (it *InsertTask) Execute() error {
Status: &commonpb.Status{
ErrorCode: commonpb.ErrorCode_SUCCESS,
},
Begin: rowIDBegin,
End: rowIDEnd,
}
if err != nil {
it.result.Status.ErrorCode = commonpb.ErrorCode_UNEXPECTED_ERROR