From c824c297c1ddb2928167138a67c935a7c34d7af9 Mon Sep 17 00:00:00 2001 From: groot Date: Tue, 7 Apr 2020 10:05:37 +0800 Subject: [PATCH] build index wait interval (#1872) * #1827 Combine request target vectors exceed max nq Signed-off-by: groot * refine dbimpl Signed-off-by: groot * refine dbimpl Signed-off-by: groot * fix unittest failure Signed-off-by: groot * merge master Signed-off-by: groot * refine meta code Signed-off-by: groot * set build index check interval to 5 seconds Signed-off-by: groot Co-authored-by: Jin Hai --- core/src/db/DBImpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 3191c884..39a15c4a 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -55,6 +55,7 @@ namespace engine { namespace { constexpr uint64_t BACKGROUND_METRIC_INTERVAL = 1; constexpr uint64_t BACKGROUND_INDEX_INTERVAL = 1; +constexpr uint64_t WAIT_BUILD_INDEX_INTERVAL = 5; static const Status SHUTDOWN_ERROR = Status(DB_ERROR, "Milvus server is shutdown!"); @@ -1740,7 +1741,7 @@ DBImpl::WaitCollectionIndexRecursively(const std::string& collection_id, const C status = meta_ptr_->UpdateCollectionFilesToIndex(collection_id); } - std::this_thread::sleep_for(std::chrono::milliseconds(std::min(10 * 1000, times * 100))); + std::this_thread::sleep_for(std::chrono::seconds(WAIT_BUILD_INDEX_INTERVAL)); GetFilesToBuildIndex(collection_id, file_types, collection_files); ++times; -- GitLab