Signed-off-by: Zhiru Zhu <zzhu@fandm.edu>
This commit is contained in:
Zhiru Zhu 2020-03-10 16:40:17 +08:00
parent 442bf43402
commit 4625bf3710
No known key found for this signature in database
GPG Key ID: AB8AD6F124821076
2 changed files with 9 additions and 5 deletions

View File

@ -57,6 +57,7 @@ Please mark all change in change log and use the issue from GitHub
- \#1577 Row count incorrect if delete vectors then create index
- \#1580 Old segment folder not removed after merge/compact if create_index is called before adding data
- \#1590 Server down caused by failure to write file during concurrent mixed operations
- \#1598 Server down during mixed operations
## Feature
- \#216 Add CLI to get server info

View File

@ -264,13 +264,16 @@ XSearchTask::Execute() {
// step 3: pick up topk result
auto spec_k = file_->row_count_ < topk ? file_->row_count_ : topk;
if (search_job->GetResultIds().front() == -1 && search_job->GetResultIds().size() > spec_k) {
// initialized results set
search_job->GetResultIds().resize(spec_k);
search_job->GetResultDistances().resize(spec_k);
}
{
std::unique_lock<std::mutex> lock(search_job->mutex());
if (search_job->GetResultIds().front() == -1 && search_job->GetResultIds().size() > spec_k) {
// initialized results set
search_job->GetResultIds().resize(spec_k);
search_job->GetResultDistances().resize(spec_k);
}
XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, ascending_reduce,
search_job->GetResultIds(), search_job->GetResultDistances());
}