mirror of https://github.com/milvus-io/milvus.git
commit
81d767ea2f
|
@ -664,9 +664,9 @@ DBImpl::Compact(const std::string& table_id) {
|
|||
|
||||
ENGINE_LOG_DEBUG << "Before compacting, wait for build index thread to finish...";
|
||||
|
||||
WaitBuildIndexFinish();
|
||||
// WaitBuildIndexFinish();
|
||||
|
||||
std::lock_guard<std::mutex> index_lock(index_result_mutex_);
|
||||
const std::lock_guard<std::mutex> index_lock(build_index_mutex_);
|
||||
const std::lock_guard<std::mutex> merge_lock(flush_merge_compact_mutex_);
|
||||
|
||||
ENGINE_LOG_DEBUG << "Compacting table: " << table_id;
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#include "scheduler/job/BuildIndexJob.h"
|
||||
#include "utils/Log.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "utils/Log.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace scheduler {
|
||||
|
||||
|
@ -34,7 +35,8 @@ BuildIndexJob::AddToIndexFiles(const engine::meta::TableFileSchemaPtr& to_index_
|
|||
return false;
|
||||
}
|
||||
|
||||
SERVER_LOG_DEBUG << "BuildIndexJob " << id() << " add to_index file: " << to_index_file->id_;
|
||||
SERVER_LOG_DEBUG << "BuildIndexJob " << id() << " add to_index file: " << to_index_file->id_
|
||||
<< ", location: " << to_index_file->location_;
|
||||
|
||||
to_index_files_[to_index_file->id_] = to_index_file;
|
||||
}
|
||||
|
|
|
@ -266,14 +266,19 @@ XSearchTask::Execute() {
|
|||
|
||||
// step 3: pick up topk result
|
||||
auto spec_k = file_->row_count_ < topk ? file_->row_count_ : topk;
|
||||
if (spec_k == 0) {
|
||||
ENGINE_LOG_WARNING << "Searching in an empty file. file location = " << file_->location_;
|
||||
}
|
||||
|
||||
{
|
||||
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);
|
||||
if (search_job->GetResultIds().size() > spec_k) {
|
||||
if (search_job->GetResultIds().front() == -1) {
|
||||
// initialized results set
|
||||
search_job->GetResultIds().resize(spec_k * nq);
|
||||
search_job->GetResultDistances().resize(spec_k * nq);
|
||||
}
|
||||
}
|
||||
|
||||
XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, ascending_reduce,
|
||||
|
|
Loading…
Reference in New Issue