mirror of https://github.com/milvus-io/milvus.git
Fix insert failed to return correct id range
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/4973/head^2
parent
d88a654db8
commit
24942c3d6d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue