From dc7e38244c8a6edde61fcb554670dc1b716422f0 Mon Sep 17 00:00:00 2001 From: yaphet <4414314+darionyaphet@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:41:42 +0800 Subject: [PATCH] unify leader change and machine not found (#4022) Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> --- src/clients/meta/MetaClient.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index 4a57894c53a..c8de564aef8 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -746,7 +746,8 @@ void MetaClient::getResponse(Request req, // succeeded pro.setValue(respGen(std::move(resp))); return; - } else if (code == nebula::cpp2::ErrorCode::E_LEADER_CHANGED) { + } else if (code == nebula::cpp2::ErrorCode::E_LEADER_CHANGED || + code == nebula::cpp2::ErrorCode::E_MACHINE_NOT_FOUND) { updateLeader(resp.get_leader()); if (retry < retryLimit) { evb->runAfterDelay( @@ -772,8 +773,6 @@ void MetaClient::getResponse(Request req, } else if (code == nebula::cpp2::ErrorCode::E_CLIENT_SERVER_INCOMPATIBLE) { pro.setValue(respGen(std::move(resp))); return; - } else if (resp.get_code() == nebula::cpp2::ErrorCode::E_MACHINE_NOT_FOUND) { - updateLeader(); } pro.setValue(this->handleResponse(resp)); }); // then