mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 21:09:06 +08:00
Fix parallel merge issue
Former-commit-id: 7eae24c65e50c6c0abc423b841c14bf16a8c0a1d
This commit is contained in:
parent
e316271a0d
commit
71fa8bdd05
@ -90,6 +90,10 @@ class SearchJob : public Job {
|
||||
return index_files_;
|
||||
}
|
||||
|
||||
std::mutex& mutex() {
|
||||
return mutex_;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64_t topk_ = 0;
|
||||
uint64_t nq_ = 0;
|
||||
|
@ -219,8 +219,11 @@ XSearchTask::Execute() {
|
||||
|
||||
// step 3: pick up topk result
|
||||
auto spec_k = index_engine_->Count() < topk ? index_engine_->Count() : topk;
|
||||
XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, metric_l2,
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(search_job->mutex());
|
||||
XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, metric_l2,
|
||||
search_job->GetResult());
|
||||
}
|
||||
|
||||
span = rc.RecordSection(hdr + ", reduce topk");
|
||||
// search_job->AccumReduceCost(span);
|
||||
|
Loading…
Reference in New Issue
Block a user