[SERVER-14531] Abort election if freshness check cannot ensure majority of voters Created: 11/Jul/14  Updated: 25/Oct/14  Resolved: 15/Oct/14

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Improvement Priority: Major - P3
Reporter: Zardosht Kasheff Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-14382 CmdReplSetFresh should take last elec... Closed
Tested
Backwards Compatibility: Minor Change
Participants:

 Description   

Add an additional requirement to freshness checking to ensure that a majority of voters can vote in the election before starting. This additional check will result in a fail-fast path when a majority won't be voting, and might reduce election times when a majority is later available.

Longer Explanation
This issue is similar to SERVER-14382, in that you don't want the election protocol to call CmdReplSetElect if you have any reason to believe that the election will not be successful. Calling CmdReplSetElect and failing is bad because members that do vote "yes" will be barred from voting for 30 seconds.

A candidate determines that a majority of the replica set is up by looking at the state of member heartbeats, via Consensus::aMajoritySeemsToBeUp(). If a network was just partitioned, this information may be inaccurate, because the latest heartbeats may not have failed yet. So, when a candidate calls CmdReplSetFresh to guage whether it should run an election, it should count the number of responses it gets to ensure a majority is truly up. With the code now, less than a majority may respond saying "go ahead", and the election protocol still proceeds to call CmdReplSetElect.



 Comments   
Comment by Githook User [ 10/Oct/14 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-14531: ensure enough freshness responses
Branch: master
https://github.com/mongodb/mongo/commit/9d0f6650eff7c1e467a55d01ceb9e425eb86e7c6

Comment by Eric Milkie [ 18/Jul/14 ]

We're proposing to do away with the 30 second voting period, so after we're done with the refactor we'll come back to this and make sure it's no longer an issue. Thanks for reporting it!

Generated at Thu Feb 08 03:35:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.