-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
Replication
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.