From 3c830129bc31240a1318fb8c954e0ad88fab8f2d Mon Sep 17 00:00:00 2001 From: liwenhui-soul <38217397+liwenhui-soul@users.noreply.github.com> Date: Tue, 18 Jan 2022 20:05:28 +0800 Subject: [PATCH] continue running balance task from last status --- src/meta/processors/job/BalancePlan.cpp | 1 - src/meta/test/BalancerTest.cpp | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/meta/processors/job/BalancePlan.cpp b/src/meta/processors/job/BalancePlan.cpp index 84ed777e57f..40678b0c528 100644 --- a/src/meta/processors/job/BalancePlan.cpp +++ b/src/meta/processors/job/BalancePlan.cpp @@ -234,7 +234,6 @@ ErrorOr> 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); diff --git a/src/meta/test/BalancerTest.cpp b/src/meta/test/BalancerTest.cpp index 6e0fc937ca2..0221a639543 100644 --- a/src/meta/test/BalancerTest.cpp +++ b/src/meta/test/BalancerTest.cpp @@ -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();