This is an automated email from the ASF dual-hosted git repository.

abukor 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 6b1aa04f8 KUDU-1973 Fix caching in MultiRaftManager.
6b1aa04f8 is described below

commit 6b1aa04f8cffa5d0242fd52d210a0d8db2f8dce6
Author: Zoltan Martonka <[email protected]>
AuthorDate: Tue Sep 30 13:03:38 2025 +0000

    KUDU-1973 Fix caching in MultiRaftManager.
    
    Currently, if another TServer disappears or we stop having followers on it
    for any consensus, and later we need batching for it again, the batcher
    is not cached, and every Raft consensus gets a distinct batcher.
    This defeats the whole purpose of the feature and loses the
    performance improvements.
    However, this bug still allows Raft to work correctly, which is why unit
    tests are green even with --enable_multi_raft_heartbeat_batcher=1.
    
    Also adding spaces to the multi_raft_heartbeat_window_ms flag description.
    
    Change-Id: I254217d7099f8b773868df5724b78123bd49a287
    Reviewed-on: http://gerrit.cloudera.org:8080/23477
    Reviewed-by: Zoltan Chovan <[email protected]>
    Reviewed-by: Attila Bukor <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
    Tested-by: Attila Bukor <[email protected]>
---
 src/kudu/consensus/multi_raft_batcher.cc | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/kudu/consensus/multi_raft_batcher.cc 
b/src/kudu/consensus/multi_raft_batcher.cc
index 0eea97935..87c23023a 100644
--- a/src/kudu/consensus/multi_raft_batcher.cc
+++ b/src/kudu/consensus/multi_raft_batcher.cc
@@ -56,13 +56,13 @@ DECLARE_int32(consensus_rpc_timeout_ms);
 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"
+  "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"
-  "set it any lower."
-  "This value is also forced to be less than or equal to half of the heartbeat 
interval,"
+  "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 "
+  "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."
 );
 TAG_FLAG(multi_raft_heartbeat_window_ms, experimental);
@@ -283,7 +283,7 @@ MultiRaftHeartbeatBatcherPtr 
MultiRaftManager::AddOrGetBatcher(
   batcher = std::make_shared<MultiRaftHeartbeatBatcher>(
       hostport, dns_resolver_, messenger_, batch_time_window_, 
raft_pool_token);
   batcher->StartTimer();
-  batchers_.insert({hostport, BatcherAndPoolToken(batcher, raft_pool_token)});
+  batchers_.insert_or_assign(hostport, BatcherAndPoolToken(batcher, 
raft_pool_token));
   return batcher;
 }
 

Reply via email to