Skip to content

Commit

Permalink
continue running balance task from last status
Browse files Browse the repository at this point in the history
  • Loading branch information
liwenhui-soul committed Jan 19, 2022
1 parent 2247da4 commit 3c83012
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/meta/processors/job/BalancePlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ ErrorOr<nebula::cpp2::ErrorCode, std::vector<BalanceTask>> BalancePlan::getBalan
if (task.ret_ == BalanceTaskResult::FAILED || task.ret_ == BalanceTaskResult::INVALID) {
task.ret_ = BalanceTaskResult::IN_PROGRESS;
}
task.status_ = BalanceTaskStatus::START;
auto activeHostRet = ActiveHostsMan::isLived(kv, task.dst_);
if (!nebula::ok(activeHostRet)) {
auto retCode = nebula::error(activeHostRet);
Expand Down
8 changes: 6 additions & 2 deletions src/meta/test/BalancerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,12 @@ TEST(BalanceTest, RecoveryTest) {
partCount,
6);
balancer.recovery();
verifyBalanceTask(
kv, balancer.jobId_, BalanceTaskStatus::START, BalanceTaskResult::IN_PROGRESS, partCount, 6);
verifyBalanceTask(kv,
balancer.jobId_,
BalanceTaskStatus::CATCH_UP_DATA,
BalanceTaskResult::IN_PROGRESS,
partCount,
6);
baton.reset();
balancer.setFinishCallBack([&](meta::cpp2::JobStatus) {
baton.post();
Expand Down

0 comments on commit 3c83012

Please sign in to comment.