Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/14954 )
Change subject: [consensus] short-circuit response path for RequestVote() ...................................................................... [consensus] short-circuit response path for RequestVote() I saw cases of contention on replica's RaftConsensus lock when the filesystem was slow on updating Raft metadata files after receiving Raft update message from a leader replica, while there was a vote request from another follower replica waiting on the RaftConsensus object's lock. The latter request would be simply rejected after just after acquiring the lock because of the recent updates on the voting withhold interval. This patch updates the code by moving the last-heard-from-leader check into the very beginning of the method, so it's possible to respond NO to a vote request without acquiring the lock in case if receiving Raft heartbeats from the leader replica just recently. It should help a bit with the overflow of the RaftConsensus RPC queue during election storms. Change-Id: I67efef72b74ce243ca060e89fcec6eb11e95e8e8 Reviewed-on: http://gerrit.cloudera.org:8080/14954 Tested-by: Alexey Serbin <[email protected]> Reviewed-by: Adar Dembo <[email protected]> --- M src/kudu/consensus/raft_consensus.cc M src/kudu/consensus/raft_consensus.h M src/kudu/util/monotime.cc M src/kudu/util/monotime.h 4 files changed, 93 insertions(+), 64 deletions(-) Approvals: Alexey Serbin: Verified Adar Dembo: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/14954 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I67efef72b74ce243ca060e89fcec6eb11e95e8e8 Gerrit-Change-Number: 14954 Gerrit-PatchSet: 6 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120)
