[SERVER-44516] Replica sets with more than 1 node but 1 voting node should have faster elections Created: 08/Nov/19  Updated: 06/Dec/22  Resolved: 14/Nov/19

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

Type: Improvement Priority: Major - P3
Reporter: Judah Schvimer Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

We have special code to have prompt elections when there is one replica set member. It would make sense for this code to also exist in replica sets with one voting member.

We also don't always report the right reason for running for election in this case like here where we call it a kElectionTimeout rather than a kSingleNodePromptElection.

We would also need to look at:
https://github.com/mongodb/mongo/blob/2070d8ca09576b858c61677bc366a25e7ecfecad/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp#L892
https://github.com/mongodb/mongo/blob/ec44fef95a3e7a6620df1ff67796b9d4566aeecb/src/mongo/db/repl/replication_coordinator_impl.cpp#L2925

I'm not sure how common this use case is though.


Generated at Thu Feb 08 05:06:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.