Skip to content

Commit

Permalink
[fix] Simplified tasklist code
Browse files Browse the repository at this point in the history
  • Loading branch information
visualYJD committed Jan 12, 2025
1 parent 6973afb commit 421a60a
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 190 deletions.
17 changes: 11 additions & 6 deletions src/coordinator/coordinator_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -893,15 +893,20 @@ class CoordinatorControl : public MetaControl {

butil::Status UpdateTaskProcess(const pb::coordinator_internal::MetaIncrementTaskList &task_list);

bool UpdateMoveTaskRegionCmd(pb::coordinator::TaskList &task_list, int64_t old_store_id, int64_t new_store_id,
int64_t region_cmd_id);
bool UpdateMoveTaskRegionCmd(pb::coordinator::TaskList &task_list, int64_t new_store_id, int64_t region_cmd_id);

static bool AllParallelTasksSuccess(const pb::coordinator::Task &task);
void UpdateTaskRegionCmdStatus(pb::coordinator::Task &task,
pb::coordinator_internal::MetaIncrementRegionCmdStatus region_cmd_status);

static bool NeedAutoCleanTaskList(const pb::coordinator::TaskList &task_list,
const pb::coordinator::Task &current_task);
bool AllParallelTasksSuccess(pb::coordinator::TaskList &task_list, int64_t region_cmd_id);

bool NeedAutoCleanTaskList(const pb::coordinator::TaskList &task_list, const pb::coordinator::Task &current_task);

pb::coordinator::Task *FindTaskByRegionCmd(pb::coordinator::TaskList &task_list, int64_t region_cmd_id,
bool &parallel_task, int32_t &current_step);

pb::coordinator::Task *FindParallelParentTaskByRegionCmd(pb::coordinator::TaskList &task_list, int64_t region_cmd_id);

// pb::coordinator::Task* FindTaskByRegionCmd(const pb::coordinator::TaskList &task_list, int64_t region_cmd_id);
bool DoTaskPreCheck(const pb::coordinator::TaskPreCheck &task_pre_check);

butil::Status CleanTaskList(int64_t task_list_id, pb::coordinator_internal::MetaIncrement &meta_increment);
Expand Down
Loading

0 comments on commit 421a60a

Please sign in to comment.