mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 05:18:52 +08:00
fix id miss bug
Former-commit-id: 53581de275e862ca9574014a6bd025918077dc59
This commit is contained in:
parent
9941416b82
commit
224fae759c
@ -488,10 +488,14 @@ ServerError AddBatchVectorTask::OnExecute() {
|
||||
std::list<std::future<void>> threads_list;
|
||||
|
||||
uint64_t begin_index = 0, end_index = USE_MT;
|
||||
while(end_index < vec_count) {
|
||||
while(true) {
|
||||
threads_list.push_back(
|
||||
GetThreadPool().enqueue(&AddBatchVectorTask::ProcessIdMapping,
|
||||
this, vector_ids, begin_index, end_index, tensor_ids_));
|
||||
if(end_index >= vec_count) {
|
||||
break;
|
||||
}
|
||||
|
||||
begin_index = end_index;
|
||||
end_index += USE_MT;
|
||||
if(end_index > vec_count) {
|
||||
|
@ -211,7 +211,10 @@ TEST(AddVector, CLIENT_TEST) {
|
||||
server::TimeRecorder rc("Add " + std::to_string(count) + " binary vectors in one batch");
|
||||
std::vector<std::string> ids;
|
||||
session.interface()->add_binary_vector_batch(ids, group.id, bin_tensor_list_2);
|
||||
ASSERT_TRUE(!ids.empty());
|
||||
ASSERT_EQ(ids.size(), bin_tensor_list_2.tensor_list.size());
|
||||
for(size_t i = 0; i < ids.size(); i++) {
|
||||
ASSERT_TRUE(!ids[i].empty());
|
||||
}
|
||||
rc.Elapse("done!");
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user