mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
BuildIndex stop when do build index and search simultaneously
This commit is contained in:
parent
8a4cc9263e
commit
c07aa9a015
@ -21,6 +21,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
||||
- \#440 - Server cannot startup with gpu_resource_config.enable=false in GPU version
|
||||
- \#458 - Index data is not compatible between 0.5 and 0.6
|
||||
- \#486 - gpu no usage during index building
|
||||
- \#530 - BuildIndex stop when do build index and search simultaneously
|
||||
|
||||
## Feature
|
||||
- \#12 - Pure CPU version for Milvus
|
||||
|
||||
@ -55,6 +55,11 @@ class BuildMgr {
|
||||
}
|
||||
}
|
||||
|
||||
int64_t
|
||||
NumOfAvailable() {
|
||||
return available_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::int64_t available_;
|
||||
std::mutex mutex_;
|
||||
|
||||
@ -178,7 +178,8 @@ TaskTable::PickToLoad(uint64_t limit) {
|
||||
|
||||
// if task is a build index task, limit it
|
||||
if (task->Type() == TaskType::BuildIndexTask && task->path().Current() == "cpu") {
|
||||
if (not BuildMgrInst::GetInstance()->Take()) {
|
||||
if (BuildMgrInst::GetInstance()->NumOfAvailable() < 1) {
|
||||
SERVER_LOG_WARNING << "BuildMgr doesnot have available place for building index";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,6 +178,10 @@ Resource::loader_function() {
|
||||
if (task_item == nullptr) {
|
||||
break;
|
||||
}
|
||||
if (task_item->task->Type() == TaskType::BuildIndexTask && name() == "cpu") {
|
||||
BuildMgrInst::GetInstance()->Take();
|
||||
SERVER_LOG_DEBUG << name() << " load BuildIndexTask";
|
||||
}
|
||||
LoadFile(task_item->task);
|
||||
task_item->Loaded();
|
||||
if (task_item->from) {
|
||||
@ -208,7 +212,6 @@ Resource::executor_function() {
|
||||
if (task_item == nullptr) {
|
||||
break;
|
||||
}
|
||||
|
||||
auto start = get_current_timestamp();
|
||||
Process(task_item->task);
|
||||
auto finish = get_current_timestamp();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user