Skip to content

Commit

Permalink
Limits for add and recover balance data or zone balance jobs (#4104)
Browse files Browse the repository at this point in the history
* If there are failed or stopped data balance or zone balance job, must firstly recover it

* address wenhaocs's comments

* address comments

* add more comments

* recover job

* add more ut

* adjust comment format

* adjust comment format

* adjust comment format
  • Loading branch information
panda-sheep authored Apr 7, 2022
1 parent 8202b54 commit 07cbbac
Show file tree
Hide file tree
Showing 56 changed files with 359 additions and 39 deletions.
2 changes: 2 additions & 0 deletions src/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ Status MetaClient::handleResponse(const RESP& resp) {
return Status::Error("No valid job!");
case nebula::cpp2::ErrorCode::E_JOB_NOT_IN_SPACE:
return Status::Error("Job not existed in chosen space!");
case nebula::cpp2::ErrorCode::E_JOB_NEED_RECOVER:
return Status::Error("Need to recover failed data balance job or zone balance job firstly!");
case nebula::cpp2::ErrorCode::E_BACKUP_EMPTY_TABLE:
return Status::Error("Backup empty table!");
case nebula::cpp2::ErrorCode::E_BACKUP_TABLE_FAILED:
Expand Down
2 changes: 2 additions & 0 deletions src/common/graph/Response.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
X(E_BALANCER_FAILURE, -2047) \
X(E_JOB_NOT_FINISHED, -2048) \
X(E_TASK_REPORT_OUT_DATE, -2049) \
X(E_JOB_NOT_IN_SPACE, -2050) \
X(E_JOB_NEED_RECOVER, -2051) \
X(E_INVALID_JOB, -2065) \
\
/* Backup Failure */ \
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/StorageAccessExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/StorageAccessExecutor.h"

#include <folly/Format.h>

#include "graph/context/Iterator.h"
#include "graph/context/QueryExpressionContext.h"
#include "graph/util/SchemaUtil.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ChangePasswordExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ChangePasswordExecutor.h"

#include <proxygen/lib/utils/CryptUtil.h>

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ConfigExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ConfigExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/conf/Configuration.h"
#include "graph/planner/plan/Admin.h"
#include "graph/util/SchemaUtil.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/CreateUserExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/CreateUserExecutor.h"

#include <proxygen/lib/utils/CryptUtil.h>

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/DescribeUserExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/DescribeUserExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"
#include "interface/gen-cpp2/meta_types.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/DropUserExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/DropUserExecutor.h"

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/KillQueryExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/KillQueryExecutor.h"

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ListRolesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ListRolesExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ListUserRolesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ListUserRolesExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/PartExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/PartExecutor.h"

#include "graph/planner/plan/Admin.h"

using nebula::network::NetworkUtils;
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/RevokeRoleExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/RevokeRoleExecutor.h"

#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "interface/gen-cpp2/meta_types.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ShowHostsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ShowHostsExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ShowMetaLeaderExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ShowMetaLeaderExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "common/time/TimeUtils.h"
#include "graph/planner/plan/Admin.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ShowServiceClientsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "graph/executor/admin/ShowServiceClientsExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "interface/gen-cpp2/meta_types.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/ShowStatsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/ShowStatsExecutor.h"

#include "graph/planner/plan/Admin.h"
#include "graph/service/PermissionManager.h"
#include "graph/util/SchemaUtil.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/admin/SignInServiceExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/SignInServiceExecutor.h"

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
2 changes: 2 additions & 0 deletions src/graph/executor/admin/SnapshotExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/admin/SnapshotExecutor.h"

#include <thrift/lib/cpp/util/EnumUtils.h>

#include "graph/planner/plan/Admin.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/logic/ArgumentExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/logic/ArgumentExecutor.h"

#include "graph/planner/plan/Logic.h"

namespace nebula {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/executor/logic/LoopExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/logic/LoopExecutor.h"
#include "graph/planner/plan/Logic.h"

#include "graph/planner/plan/Logic.h"

namespace nebula {
namespace graph {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/logic/SelectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/logic/SelectExecutor.h"

#include "graph/planner/plan/Logic.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/maintain/EdgeExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/maintain/EdgeExecutor.h"

#include "graph/planner/plan/Maintain.h"
#include "graph/util/SchemaUtil.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/maintain/FTIndexExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/maintain/FTIndexExecutor.h"

#include "graph/planner/plan/Maintain.h"
#include "graph/util/FTIndexUtils.h"
#include "interface/gen-cpp2/meta_types.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/maintain/TagExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/maintain/TagExecutor.h"

#include "graph/planner/plan/Maintain.h"
#include "graph/util/SchemaUtil.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/mutate/DeleteExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/mutate/DeleteExecutor.h"

#include "graph/planner/plan/Mutate.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/SchemaUtil.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/mutate/InsertExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/mutate/InsertExecutor.h"

#include "graph/planner/plan/Mutate.h"
#include "graph/service/GraphFlags.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/AggregateExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/AggregateExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/AssignExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/AssignExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/DataCollectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/DataCollectExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/FilterExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/FilterExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/GetEdgesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/GetEdgesExecutor.h"

#include "graph/planner/plan/Query.h"

using nebula::storage::StorageClient;
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/GetNeighborsExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/GetNeighborsExecutor.h"

#include "graph/service/GraphFlags.h"

using nebula::storage::StorageClient;
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/IndexScanExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/IndexScanExecutor.h"

#include "graph/service/GraphFlags.h"

using nebula::storage::StorageClient;
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/InnerJoinExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/InnerJoinExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/IntersectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/IntersectExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/JoinExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/JoinExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/LeftJoinExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/LeftJoinExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/LimitExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/LimitExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/MinusExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/MinusExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/ProjectExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/ProjectExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/SampleExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/SampleExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/ScanEdgesExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/ScanEdgesExecutor.h"

#include "graph/planner/plan/Query.h"
#include "graph/util/SchemaUtil.h"

Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/SetExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/SetExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/SortExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/SortExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/TopNExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/TopNExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/TraverseExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/TraverseExecutor.h"

#include "clients/storage/StorageClient.h"
#include "graph/service/GraphFlags.h"
#include "graph/util/SchemaUtil.h"
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/UnionAllVersionVarExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/UnionAllVersionVarExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
1 change: 1 addition & 0 deletions src/graph/executor/query/UnionExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// This source code is licensed under Apache 2.0 License.

#include "graph/executor/query/UnionExecutor.h"

#include "graph/planner/plan/Query.h"

namespace nebula {
Expand Down
Loading

0 comments on commit 07cbbac

Please sign in to comment.