Commit 52292164 authored by 余昆's avatar 余昆
Browse files

fix BuildIndex hang bug but not fix CreateIndex after DropIndex


Former-commit-id: 70d820bc29bc59e8ca18eaf36ec7eef01cca7f36
parent ed93701e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ void
Scheduler::OnLoadCompleted(const EventPtr& event) {
    auto load_completed_event = std::static_pointer_cast<LoadCompletedEvent>(event);
    if (auto resource = event->resource_.lock()) {
        resource->WakeupExecutor();
        //        resource->WakeupExecutor();

        auto task_table_type = load_completed_event->task_table_item_->task->label()->Type();
        switch (task_table_type) {
+5 −3
Original line number Diff line number Diff line
@@ -209,11 +209,13 @@ Action::SpecifiedResourceLabelTaskScheduler(ResourceMgrWPtr res_mgr, ResourcePtr
    } else {
        auto next_res_name = task->path().Next();
        auto next_res = res_mgr.lock()->GetResource(next_res_name);
        if (event->task_table_item_->Move()) {
        //        if (event->task_table_item_->Move()) {
        //            next_res->task_table().Put(task);
        //        }
        event->task_table_item_->Move();
        next_res->task_table().Put(task);
    }
}
}

}  // namespace scheduler
}  // namespace milvus
+14 −6
Original line number Diff line number Diff line
@@ -116,15 +116,23 @@ Resource::pick_task_execute() {
    auto indexes = task_table_.PickToExecute(std::numeric_limits<uint64_t>::max());
    for (auto index : indexes) {
        // try to set one task executing, then return
        //        if (task_table_[index]->task->label()->Type() == TaskLabelType::SPECIFIED_RESOURCE) {
        //            if (task_table_[index]->task->path().Last() != name()) {
        //                continue;
        //            }
        //        }
        //
        //        if (task_table_.Execute(index)) {
        //            return task_table_.Get(index);
        //        }
        if (task_table_[index]->task->label()->Type() == TaskLabelType::SPECIFIED_RESOURCE) {
            if (task_table_[index]->task->path().Last() != name()) {
                continue;
            }
        }

            if (task_table_.Get(index)->task->path().Current() == task_table_.Get(index)->task->path().Last() &&
                task_table_.Get(index)->task->path().Last() == name()) {
                if (task_table_.Execute(index)) {
                    return task_table_.Get(index);
                }
            }
        }
        // else try next
    }
    return nullptr;