Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

always send storage leaders to meta #424

Merged
merged 2 commits into from
Mar 2, 2021
Merged
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
4 changes: 2 additions & 2 deletions src/common/clients/meta/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <folly/executors/Async.h>
#include <folly/futures/Future.h>

DEFINE_int32(heartbeat_interval_secs, 3, "Heartbeat interval");
DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval");
DEFINE_int32(meta_client_retry_times, 3, "meta client retry times, 0 means no retry");
DEFINE_int32(meta_client_retry_interval_secs, 1,
"meta client sleep interval between retry");
Expand Down Expand Up @@ -2297,8 +2297,8 @@ folly::Future<StatusOr<bool>> MetaClient::heartbeat() {
leaderIds_.clear();
leaderIds_ = leaderIds;
}
req.set_leader_partIds(std::move(leaderIds));
}
req.set_leader_partIds(std::move(leaderIds));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the advantage?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good
In the past, if leaderIds_ = leaderIds was executed and the subsequent future_heartBeat failed to execute, would the execution fail forever before the next leader change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In worst case, if this heartbeat carry leader info, and RPC failed because of network or something else, meta will never get this storaged's leader info

} else {
req.set_leader_partIds(std::move(leaderIds));
}
Expand Down