]> git.proxmox.com Git - ovs.git/commitdiff
raft: Avoid sending unnecessary heartbeat when becoming leader.
authorHan Zhou <hzhou@ovn.org>
Sat, 29 Feb 2020 02:07:08 +0000 (18:07 -0800)
committerBen Pfaff <blp@ovn.org>
Fri, 6 Mar 2020 22:01:08 +0000 (14:01 -0800)
When a node becomes leader, it sends out heartbeat to all followers
and then sends out another append-request for a no-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@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovsdb/raft.c

index 6cd7b0041a3936fb7602d287db7e988a03cc0c30..0eb8644f395bcff05ae2335cda2c29e7d88a8ef2 100644 (file)
@@ -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