[ovs-dev] [PATCH 5/7] raft: Avoid sending unnecessary heartbeat when becoming leader.

Han Zhou hzhou at ovn.org
Sat Feb 29 02:07:08 UTC 2020


When a node becomes leader, it sends out heartbeat to all followers
and then sends out another append-request for a non-op command
execution to all followers again immediately. This causes 2
continously append-requests sent out to each followers, and the first
heartbeat append-request is unnecessary. This patch removes the
heartbeat.

Signed-off-by: Han Zhou <hzhou at ovn.org>
---
 ovsdb/raft.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ovsdb/raft.c b/ovsdb/raft.c
index 6cd7b00..0eb8644 100644
--- a/ovsdb/raft.c
+++ b/ovsdb/raft.c
@@ -2553,7 +2553,6 @@ raft_become_leader(struct raft *raft)
     raft->election_timer_new = 0;
 
     raft_update_our_match_index(raft, raft->log_end - 1);
-    raft_send_heartbeats(raft);
 
     /* Write the fact that we are leader to the log.  This is not used by the
      * algorithm (although it could be, for quick restart), but it is used for
-- 
2.1.0



More information about the dev mailing list