diff --git a/cpp/src/db/DBImpl.cpp b/cpp/src/db/DBImpl.cpp index 09a7c72201..c6365bc38b 100644 --- a/cpp/src/db/DBImpl.cpp +++ b/cpp/src/db/DBImpl.cpp @@ -229,7 +229,6 @@ void DBImpl::BackgroundTimerTask() { Status status; server::SystemInfo::GetInstance().Init(); while (true) { - if (!bg_error_.ok()) break; if (shutting_down_.load(std::memory_order_acquire)){ for(auto& iter : compact_thread_results_) { iter.wait(); @@ -392,7 +391,7 @@ void DBImpl::BackgroundCompaction(std::set table_ids) { for (auto& table_id : table_ids) { status = BackgroundMergeFiles(table_id); if (!status.ok()) { - bg_error_ = status; + ENGINE_LOG_ERROR << "Merge files for table " << table_id << " failed: " << status.ToString(); return; } } @@ -498,7 +497,7 @@ void DBImpl::BackgroundBuildIndex() { /* ENGINE_LOG_DEBUG << "Buiding index for " << file.location; */ status = BuildIndex(file); if (!status.ok()) { - bg_error_ = status; + ENGINE_LOG_ERROR << "Building index for " << file.id_ << " failed: " << status.ToString(); return; } diff --git a/cpp/src/db/DBImpl.h b/cpp/src/db/DBImpl.h index 5601f1a33b..012a445ef1 100644 --- a/cpp/src/db/DBImpl.h +++ b/cpp/src/db/DBImpl.h @@ -114,10 +114,8 @@ class DBImpl : public DB { BuildIndex(const meta::TableFileSchema &); private: - const Options options_; - Status bg_error_; std::atomic shutting_down_; std::thread bg_timer_thread_; diff --git a/cpp/src/db/ExecutionEngineImpl.cpp b/cpp/src/db/ExecutionEngineImpl.cpp index 64aabb3777..ead97dfe38 100644 --- a/cpp/src/db/ExecutionEngineImpl.cpp +++ b/cpp/src/db/ExecutionEngineImpl.cpp @@ -37,14 +37,17 @@ VecIndexPtr ExecutionEngineImpl::CreatetVecIndex(EngineType type) { std::shared_ptr index; switch (type) { case EngineType::FAISS_IDMAP: { + ENGINE_LOG_DEBUG << "Build Index: IDMAP"; index = GetVecIndexFactory(IndexType::FAISS_IDMAP); break; } case EngineType::FAISS_IVFFLAT_GPU: { + ENGINE_LOG_DEBUG << "Build Index: IVFMIX"; index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_MIX); break; } case EngineType::FAISS_IVFFLAT_CPU: { + ENGINE_LOG_DEBUG << "Build Index: IVFCPU"; index = GetVecIndexFactory(IndexType::FAISS_IVFFLAT_CPU); break; } @@ -135,6 +138,7 @@ ExecutionEngineImpl::BuildIndex(const std::string &location) { auto from_index = std::dynamic_pointer_cast(index_); auto to_index = CreatetVecIndex(build_type); + ENGINE_LOG_DEBUG << "Build Params: [gpu_id] " << gpu_num; to_index->BuildAll(Count(), from_index->GetRawVectors(), from_index->GetRawIds(), @@ -148,6 +152,7 @@ Status ExecutionEngineImpl::Search(long n, long k, float *distances, long *labels) const { + ENGINE_LOG_DEBUG << "Search Params: [k] " << k << " [nprobe] " << nprobe_; index_->Search(n, data, distances, labels, Config::object{{"k", k}, {"nprobe", nprobe_}}); return Status::OK(); } @@ -169,7 +174,7 @@ Status ExecutionEngineImpl::Init() { } case EngineType::FAISS_IVFFLAT_CPU: { ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE); - nprobe_ = engine_config.GetInt32Value(CONFIG_NPROBE, 1000); + nprobe_ = engine_config.GetInt32Value(CONFIG_NPROBE, 1); break; } }