mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: godchen0212 <qingxiang.chen@zilliz.com>pull/3586/head^2
parent
4546021810
commit
ef5f3a8620
|
@ -86,9 +86,12 @@ DeletedDocsFormat::Write(const storage::FSHandlerPtr& fs_ptr, const std::string&
|
|||
size_t old_num_bytes;
|
||||
std::vector<engine::offset_t> delete_ids;
|
||||
if (exists) {
|
||||
CHECK_MAGIC_VALID(fs_ptr, full_file_path);
|
||||
CHECK_SUM_VALID(fs_ptr, full_file_path);
|
||||
if (!fs_ptr->reader_ptr_->Open(temp_path)) {
|
||||
return Status(SERVER_CANNOT_OPEN_FILE, "Fail to open tmp deleted docs file: " + temp_path);
|
||||
}
|
||||
fs_ptr->reader_ptr_->Seekg(MAGIC_SIZE + HEADER_SIZE);
|
||||
fs_ptr->reader_ptr_->Read(&old_num_bytes, sizeof(size_t));
|
||||
delete_ids.resize(old_num_bytes / sizeof(engine::offset_t));
|
||||
fs_ptr->reader_ptr_->Read(delete_ids.data(), old_num_bytes);
|
||||
|
|
|
@ -217,6 +217,8 @@ Resource::executor_function() {
|
|||
ResMgrInst::GetInstance()->GetResource("disk")->WakeupLoader();
|
||||
}
|
||||
|
||||
task_item->task = FinishedTask::Create(task_item->task);
|
||||
|
||||
if (subscriber_) {
|
||||
auto event = std::make_shared<FinishTaskEvent>(shared_from_this(), task_item);
|
||||
subscriber_(std::static_pointer_cast<Event>(event));
|
||||
|
|
|
@ -14,11 +14,14 @@
|
|||
namespace milvus::scheduler {
|
||||
|
||||
std::shared_ptr<FinishedTask>
|
||||
FinishedTask::Create() {
|
||||
return std::make_shared<FinishedTask>();
|
||||
FinishedTask::Create(const TaskPtr& task) {
|
||||
return std::make_shared<FinishedTask>(task);
|
||||
}
|
||||
|
||||
FinishedTask::FinishedTask() : Task(TaskType::SearchTask, nullptr) {
|
||||
FinishedTask::FinishedTask(const TaskPtr& task) : Task(TaskType::SearchTask, nullptr) {
|
||||
Task::task_path_ = task->task_path_;
|
||||
Task::type_ = task->type_;
|
||||
Task::label_ = task->label_;
|
||||
}
|
||||
|
||||
Status
|
||||
|
|
|
@ -20,10 +20,10 @@ namespace milvus::scheduler {
|
|||
class FinishedTask : public Task {
|
||||
public:
|
||||
static std::shared_ptr<FinishedTask>
|
||||
Create();
|
||||
Create(const TaskPtr& task);
|
||||
|
||||
public:
|
||||
FinishedTask();
|
||||
explicit FinishedTask(const TaskPtr& task);
|
||||
|
||||
Status
|
||||
OnLoad(LoadType type, uint8_t device_id) override;
|
||||
|
|
Loading…
Reference in New Issue