Skip to content

Commit

Permalink
Use FLAGS_heartbeat_rpc_timeout_ms for heartbeater's timeout
Browse files Browse the repository at this point in the history
instead of hardcoding 10sec timeout #2418

Summary:
Currently, the TS uses a hard-coded 10 sec timeout for the heartbeat RPC.
If the TServer has a lot of tablets, the initial RPC reporting the full tablet report can take a long time.

Use FLAGS_heartbeat_rpc_timeout_ms to make this configurable for such large clusters.

Test Plan: eyeball

Reviewers: kannan, mihnea, hector

Reviewed By: hector

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D7279
  • Loading branch information
amitanandaiyer authored and m-iancu committed Sep 30, 2019
1 parent 2b84e00 commit b1440f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/yb/tserver/heartbeater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ using namespace std::literals;
DEFINE_int32(heartbeat_rpc_timeout_ms, 15000,
"Timeout used for the TS->Master heartbeat RPCs.");
TAG_FLAG(heartbeat_rpc_timeout_ms, advanced);
TAG_FLAG(heartbeat_rpc_timeout_ms, runtime);

DEFINE_int32(heartbeat_interval_ms, 1000,
"Interval at which the TS heartbeats to the master.");
TAG_FLAG(heartbeat_interval_ms, advanced);
TAG_FLAG(heartbeat_interval_ms, runtime);

DEFINE_int32(heartbeat_max_failures_before_backoff, 3,
"Maximum number of consecutive heartbeat failures until the "
Expand Down Expand Up @@ -435,7 +437,7 @@ Status Heartbeater::Thread::TryHeartbeat() {
}

RpcController rpc;
rpc.set_timeout(MonoDelta::FromSeconds(10));
rpc.set_timeout(MonoDelta::FromMilliseconds(FLAGS_heartbeat_rpc_timeout_ms));

req.set_config_index(server_->GetCurrentMasterIndex());

Expand Down

0 comments on commit b1440f7

Please sign in to comment.