-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add a console command to show meta leader #2542
Conversation
|
||
folly::Future<Status> ShowMetaLeaderExecutor::execute() { | ||
SCOPED_TIMER(&execTime_); | ||
auto metaLeader = qctx()->getMetaClient()->getMetaLeader(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about record a time of last hb succeed in meta client, when now - last > threshold
, just return some error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
auto metaLeader = qctx()->getMetaClient()->getMetaLeader(); | ||
auto lastHeartBeatTime = qctx()->getMetaClient()->getLastHeartBeatTime(); | ||
auto localTime = time::TimeUtils::utcToDateTime(lastHeartBeatTime); | ||
DataSet ds({"Meta Leader", "Last success heartbeat"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last successful heartbeat
or Last heartbeat
?
Not important
src/clients/meta/MetaClient.cpp
Outdated
@@ -608,6 +609,8 @@ void MetaClient::getResponse(Request req, | |||
auto&& resp = t.value(); | |||
if (resp.get_code() == nebula::cpp2::ErrorCode::SUCCEEDED) { | |||
// succeeded | |||
lastHeartBeatTime_ = time::TimeUtils::utcDateTime(); | |||
LOG(INFO) << "utcDateTime() : " << lastHeartBeatTime_.toString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not proper to log
here, this interface is heavily used by MetaClient.
src/clients/meta/MetaClient.h
Outdated
@@ -599,6 +599,10 @@ class MetaClient { | |||
|
|||
folly::Future<StatusOr<bool>> ingest(GraphSpaceID spaceId); | |||
|
|||
HostAddr getMetaLeader() { return leader_; } | |||
|
|||
DateTime getLastHeartBeatTime() { return lastHeartBeatTime_; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to HeatbeatTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean heartbeat is one word not two words, please don't capitalize the part beat
. Use Heartbeat
just a question, "Last success heartbeat" means meta raft heartbeat or heartbeat from graph to meta leader?
|
Good question, the answer is A. (Actually I will change it to interval from last heart beat, |
OK, clear |
60e7b79
to
3389c8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
Please add test |
* Support the tck format for the output of EXPLAIN * Support the tck format for the output of EXPLAIN --------- Co-authored-by: AntiTopQuark <[email protected]> Co-authored-by: Sophie <[email protected]>
add a command to show the leader of meta.