Skip to content

Commit

Permalink
fix #5305 (#5304)
Browse files Browse the repository at this point in the history
  • Loading branch information
critical27 authored Feb 1, 2023
1 parent 970e06c commit c12fc89
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/meta/processors/zone/DropHostsProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ void DropHostsProcessor::process(const cpp2::DropHostsReq& req) {
// Check that partition is not held on the host
const auto& spacePrefix = MetaKeyUtils::spacePrefix();
auto spaceIterRet = doPrefix(spacePrefix);
if (!nebula::ok(spaceIterRet)) {
LOG(INFO) << "List space failed";
handleErrorCode(nebula::error(spaceIterRet));
onFinished();
return;
}
auto spaceIter = nebula::value(spaceIterRet).get();
nebula::cpp2::ErrorCode code = nebula::cpp2::ErrorCode::SUCCEEDED;
std::map<GraphSpaceID, meta::cpp2::SpaceDesc> spaceMap;
Expand All @@ -48,6 +54,12 @@ void DropHostsProcessor::process(const cpp2::DropHostsReq& req) {
spaceMap.emplace(spaceId, MetaKeyUtils::parseSpace(spaceIter->val()));
const auto& partPrefix = MetaKeyUtils::partPrefix(spaceId);
auto partIterRet = doPrefix(partPrefix);
if (!nebula::ok(partIterRet)) {
LOG(INFO) << "List part failed";
handleErrorCode(nebula::error(partIterRet));
onFinished();
return;
}
auto partIter = nebula::value(partIterRet).get();
while (partIter->valid()) {
auto partHosts = MetaKeyUtils::parsePartVal(partIter->val());
Expand Down
6 changes: 6 additions & 0 deletions src/meta/processors/zone/MergeZoneProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ void MergeZoneProcessor::process(const cpp2::MergeZoneReq& req) {
auto batchHolder = std::make_unique<kvstore::BatchHolder>();
// Rewrite space properties
ret = doPrefix(spacePrefix);
if (!nebula::ok(ret)) {
LOG(INFO) << "List space failed";
handleErrorCode(nebula::error(ret));
onFinished();
return;
}
iter = nebula::value(ret).get();
while (iter->valid()) {
auto id = MetaKeyUtils::spaceId(iter->key());
Expand Down

0 comments on commit c12fc89

Please sign in to comment.