diff --git a/src/meta/processors/zone/DropHostsProcessor.cpp b/src/meta/processors/zone/DropHostsProcessor.cpp index c91aaec1349..383db3c15fa 100644 --- a/src/meta/processors/zone/DropHostsProcessor.cpp +++ b/src/meta/processors/zone/DropHostsProcessor.cpp @@ -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 spaceMap; @@ -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()); diff --git a/src/meta/processors/zone/MergeZoneProcessor.cpp b/src/meta/processors/zone/MergeZoneProcessor.cpp index 50a7a0e9472..c105c4ef96f 100644 --- a/src/meta/processors/zone/MergeZoneProcessor.cpp +++ b/src/meta/processors/zone/MergeZoneProcessor.cpp @@ -141,6 +141,12 @@ void MergeZoneProcessor::process(const cpp2::MergeZoneReq& req) { auto batchHolder = std::make_unique(); // 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());