BUG 2849 : Reduce sending of duplicate replication messages
With Raft not all append entries are expected to reach the followers
so it is a requirement that when acknowledgement of an append entries
is not received we send a duplicate append entries.
In replication scenarios where a lot of rapid replication messages
are being generated the lack of equally rapid acknowledgement results
in a lot of duplicate messages being generated. This later results in
a cycle when the replies for those duplicate replication messages start
arriving and result in even more duplicate replication messages being
sent.
This patch addresses this problem by disallowing a replication message
to be generated for a follower is the nextIndex for that follower
has not changed or the time since the last replication message exceeds
the heartbeat interval. This allows us to reduce duplicates but still
allows duplicates to get generated for legitimate reasons.
Change-Id: I0918672468f4fc1da935c45c7b46c750cde619f4
Signed-off-by: Moiz Raja <moraja@cisco.com>