From e2e189bfd15ac9de32f1bf558d06a593ecda59b5 Mon Sep 17 00:00:00 2001 From: fishpenguin Date: Sat, 2 Nov 2019 16:28:34 +0800 Subject: [PATCH] #169 - IVF_FLAT search out of memory Former-commit-id: 4fb263f9e29465e29fcddbf2676e46a59c1f97d1 --- CHANGELOG.md | 1 + core/src/db/engine/ExecutionEngineImpl.cpp | 29 +++++----------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93021475..bd6edf52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Please mark all change in change log and use the ticket from JIRA. ## Bug - \#134 - JFrog cache error - \#161 - Search IVFSQHybrid crash on gpu +- \#169 - IVF_FLAT search out of memory ## Feature - \#90 - The server start error messages could be improved to enhance user experience diff --git a/core/src/db/engine/ExecutionEngineImpl.cpp b/core/src/db/engine/ExecutionEngineImpl.cpp index e0e5c39d..ee04191f 100644 --- a/core/src/db/engine/ExecutionEngineImpl.cpp +++ b/core/src/db/engine/ExecutionEngineImpl.cpp @@ -309,30 +309,13 @@ ExecutionEngineImpl::CopyToGpu(uint64_t device_id, bool hybrid) { return Status::OK(); } #endif - - auto index = std::static_pointer_cast(cache::GpuCacheMgr::GetInstance(device_id)->GetIndex(location_)); - bool already_in_cache = (index != nullptr); - if (already_in_cache) { - index_ = index; - } else { - if (index_ == nullptr) { - ENGINE_LOG_ERROR << "ExecutionEngineImpl: index is null, failed to copy to gpu"; - return Status(DB_ERROR, "index is null"); - } - - try { - index_ = index_->CopyToGpu(device_id); - ENGINE_LOG_DEBUG << "CPU to GPU" << device_id; - } catch (std::exception& e) { - ENGINE_LOG_ERROR << e.what(); - return Status(DB_ERROR, e.what()); - } + try { + index_ = index_->CopyToGpu(device_id); + ENGINE_LOG_DEBUG << "CPU to GPU" << device_id; + } catch (std::exception& e) { + ENGINE_LOG_ERROR << e.what(); + return Status(DB_ERROR, e.what()); } - - if (!already_in_cache) { - GpuCache(device_id); - } - return Status::OK(); } -- GitLab