This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 5c07add3c [consensus] Fix heartbeat batching upper limit.
5c07add3c is described below
commit 5c07add3c06a23a7333ff87daccd1ac79ae7d855
Author: Zoltan Martonka <[email protected]>
AuthorDate: Mon Feb 9 09:01:54 2026 +0000
[consensus] Fix heartbeat batching upper limit.
multi_raft_heartbeat_window_ms should be no more than
raft_heartbeat_interval_ms / 2.
Currently it is capped at FLAGS_consensus_rpc_timeout_ms / 2,
which is simply wrong.
Change-Id: Ib52f21238c7c9e76828edf5582f12b063234f56b
Reviewed-on: http://gerrit.cloudera.org:8080/23952
Tested-by: Kudu Jenkins
Reviewed-by: Zoltan Chovan <[email protected]>
Reviewed-by: Gabriella Lotz <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
src/kudu/consensus/multi_raft_batcher.cc | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/kudu/consensus/multi_raft_batcher.cc
b/src/kudu/consensus/multi_raft_batcher.cc
index 87c23023a..933451a13 100644
--- a/src/kudu/consensus/multi_raft_batcher.cc
+++ b/src/kudu/consensus/multi_raft_batcher.cc
@@ -58,12 +58,14 @@ DECLARE_int32(raft_heartbeat_interval_ms);
DEFINE_int32(multi_raft_heartbeat_window_ms, 100,
"The batch time window for heartbeat batching. "
"For minimal delay and still maximum effectiveness set "
- "multi_raft_heartbeat_window_ms = heartbeat_interval_ms * ("
- "batch_size / {estimated follower peers from the same host}) + {a little
tolerance}; "
- "however, a 0.1 * heartbeat_interval_ms is good, and there is no reason to "
+ "multi_raft_heartbeat_window_ms = raft_heartbeat_interval_ms * ("
+ "multi_raft_batch_size / {estimated follower peers from the same host})"
+ " + {a little tolerance}; "
+ "however, a 0.1 * raft_heartbeat_interval_ms is good, and there is no reason
to "
"set it any lower. "
- "This value is also forced to be less than or equal to half of the heartbeat
interval, "
- "because it makes no sense to introduce a possible delay comparable to the
heartbeat interval."
+ "This value is also forced to be less than or equal to half of "
+ "raft_heartbeat_interval_ms, because it makes no sense to introduce a
possible "
+ "delay comparable to the heartbeat interval."
);
TAG_FLAG(multi_raft_heartbeat_window_ms, experimental);
@@ -224,14 +226,14 @@ void MultiRaftHeartbeatBatcher::SendOutScheduled(
namespace {
MonoDelta GetTimeWindow() {
- // We don't want to delay more than half of the heartbeat interval.
+ // We don't want to delay more than half of the raft heartbeat interval.
// Even a quarter of the interval starts to be questionable delay,
// but half is for sure too much.
auto flush_interval =
- std::min(FLAGS_multi_raft_heartbeat_window_ms,
FLAGS_consensus_rpc_timeout_ms / 2);
+ std::min(FLAGS_multi_raft_heartbeat_window_ms,
FLAGS_raft_heartbeat_interval_ms / 2);
if (flush_interval != FLAGS_multi_raft_heartbeat_window_ms) {
LOG(ERROR) << "multi_raft_heartbeat_window_ms should not be more than "
- << " consensus_rpc_timeout_ms / 2. , forcing
multi_raft_heartbeat_window_ms = "
+ << " raft_heartbeat_interval_ms / 2. , forcing
multi_raft_heartbeat_window_ms = "
<< flush_interval;
}
return MonoDelta::FromMilliseconds(flush_interval);