mirror of https://github.com/milvus-io/milvus.git
* #2349 Drop collection timeout if too many partitions created on collection Signed-off-by: groot <yihua.mo@zilliz.com> * changelog Signed-off-by: yhmo <yihua.mo@zilliz.com> * #2373 Build index for small segment waste time on waiting background index thread finish Signed-off-by: yhmo <yihua.mo@zilliz.com>pull/2473/head
parent
257ea7782f
commit
0710ececae
|
@ -5,6 +5,7 @@ Please mark all change in change log and use the issue from GitHub
|
|||
|
||||
## Bug
|
||||
- \#2367 Fix inconsistent reading and writing when using mishards
|
||||
- \#2373 Build index for small segment waste time on waiting background index thread finish
|
||||
- \#2394 Drop collection timeout if too many partitions created on collection
|
||||
|
||||
## Feature
|
||||
|
|
|
@ -2377,17 +2377,16 @@ DBImpl::WaitCollectionIndexRecursively(const std::shared_ptr<server::Context>& c
|
|||
}
|
||||
}
|
||||
|
||||
index_req_swn_.Wait_For(std::chrono::seconds(1));
|
||||
|
||||
auto ret = index_req_swn_.Wait_For(std::chrono::seconds(1));
|
||||
// client break the connection, no need to block, check every 1 second
|
||||
if (context && context->IsConnectionBroken()) {
|
||||
LOG_ENGINE_DEBUG_ << "Client connection broken, build index in background";
|
||||
break; // just break, not return, continue to update partitions files to to_index
|
||||
}
|
||||
|
||||
// check to_index files every 5 seconds
|
||||
// check to_index files every 5 seconds or background index thread finished
|
||||
repeat++;
|
||||
if (repeat % WAIT_BUILD_INDEX_INTERVAL == 0) {
|
||||
if ((ret == std::cv_status::no_timeout) || (repeat % WAIT_BUILD_INDEX_INTERVAL == 0)) {
|
||||
GetFilesToBuildIndex(collection_id, file_types, files_holder);
|
||||
++times;
|
||||
}
|
||||
|
|
|
@ -310,22 +310,26 @@ class DBImpl : public DB, public server::CacheConfigHandler, public server::Engi
|
|||
notified_ = false;
|
||||
}
|
||||
|
||||
void
|
||||
std::cv_status
|
||||
Wait_Until(const std::chrono::system_clock::time_point& tm_pint) {
|
||||
std::unique_lock<std::mutex> lck(mutex_);
|
||||
std::cv_status ret = std::cv_status::timeout;
|
||||
if (!notified_) {
|
||||
cv_.wait_until(lck, tm_pint);
|
||||
ret = cv_.wait_until(lck, tm_pint);
|
||||
}
|
||||
notified_ = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
std::cv_status
|
||||
Wait_For(const std::chrono::system_clock::duration& tm_dur) {
|
||||
std::unique_lock<std::mutex> lck(mutex_);
|
||||
std::cv_status ret = std::cv_status::timeout;
|
||||
if (!notified_) {
|
||||
cv_.wait_for(lck, tm_dur);
|
||||
ret = cv_.wait_for(lck, tm_dur);
|
||||
}
|
||||
notified_ = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue