Skip to content

Commit

Permalink
fix the error message for verifyVersion (#5797)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole00 authored Jan 5, 2024
1 parent 66dfbf5 commit b53554b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/graph/service/GraphFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ DEFINE_uint32(ft_request_retry_times, 3, "Retry times if fulltext request failed
DEFINE_bool(enable_client_white_list, true, "Turn on/off the client white list.");
DEFINE_string(client_white_list,
nebula::getOriginVersion() + ":3.0.0",
"A white list for different client versions, separate with colon.");
"A white list for different client handshakeKey, separate with colon.");

#endif

Expand Down
6 changes: 2 additions & 4 deletions src/graph/service/GraphService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,8 @@ folly::Future<cpp2::VerifyClientVersionResp> GraphService::future_verifyClientVe
uniqueWhiteList.append(version);
});
resp.error_code_ref() = nebula::cpp2::ErrorCode::E_CLIENT_SERVER_INCOMPATIBLE;
resp.error_msg_ref() = folly::stringPrintf(
"Graph client version(%s) is not accepted, current graph client white list: %s.",
req.get_version().c_str(),
uniqueWhiteList.c_str());
resp.error_msg_ref() = folly::stringPrintf("Graph client handshakeKey(%s) is not accepted.",
req.get_version().c_str());
} else {
resp.error_code_ref() = nebula::cpp2::ErrorCode::SUCCEEDED;
}
Expand Down
2 changes: 1 addition & 1 deletion src/graph/service/test/StandAloneTestGraphFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ DEFINE_uint32(ft_request_retry_times, 3, "Retry times if fulltext request failed
DEFINE_bool(enable_client_white_list, true, "Turn on/off the client white list.");
DEFINE_string(client_white_list,
nebula::getOriginVersion() + ":3.0.0",
"A white list for different client versions, separate with colon.");
"A white list for different client handshakeKey, separate with colon.");
8 changes: 3 additions & 5 deletions src/meta/processors/admin/VerifyClientVersionProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DEFINE_bool(enable_client_white_list, true, "Turn on/off the client white list.");
DEFINE_string(client_white_list,
nebula::getOriginVersion() + ":3.0.0",
"A white list for different client versions, separate with colon.");
"A white list for different client handshakeKey, separate with colon.");

namespace nebula {
namespace meta {
Expand All @@ -21,10 +21,8 @@ void VerifyClientVersionProcessor::process(const cpp2::VerifyClientVersionReq& r
if (FLAGS_enable_client_white_list &&
whiteList.find(req.get_client_version()) == whiteList.end()) {
resp_.code_ref() = nebula::cpp2::ErrorCode::E_CLIENT_SERVER_INCOMPATIBLE;
resp_.error_msg_ref() = folly::stringPrintf(
"Meta client version(%s) is not accepted, current meta client white list: %s.",
req.get_client_version().c_str(),
FLAGS_client_white_list.c_str());
resp_.error_msg_ref() = folly::stringPrintf("Meta client handshakeKey(%s) is not accepted.",
req.get_client_version().c_str());
}

onFinished();
Expand Down

0 comments on commit b53554b

Please sign in to comment.