Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix meta crashed in #5303 #5304

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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