[SERVER-8153] Make it easier to elect specific primary Created: 11/Jan/13  Updated: 06/Dec/22  Resolved: 09/Aug/18

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

Type: Improvement Priority: Minor - P4
Reporter: eHarmony Matching Assignee: Backlog - Replication Team
Resolution: Done Votes: 0
Labels: elections
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Assigned Teams:
Replication
Participants:

 Description   

To elect a particular node as the primary, I have to go through a complicated process:

1. Connect to the existing primary.
2. Get the existing replica set configuration.
3. Set the priorities of each node in the set, with the desired new primary highest.
4. Set the new configuration.

It would be much easier if there were a single command "setPrimary(newPrimary)" or some such that would immediately elect the specified node as the primary, so long as that request was not contradicted by other configuration. In other words, in cases where multiple nodes are equally able to become primary based on their configurations, we should be able to determine which one actually gets elected.



 Comments   
Comment by Spencer Brody (Inactive) [ 09/Aug/18 ]

We believe that the server is generally in a better position to determine who should be primary than end users are.  If users want to have some control over who is primary the tool to do that with is priorities.

Comment by eHarmony Matching [ 11/Jan/13 ]

Note that the behavior of selecting a primary when initiating a replica set is not parallel to the behavior when selecting a primary at any other time. When calling rs.initiate(), the node on which the command runs becomes primary, and all nodes subsequently added become secondaries. But this is the only time a primary can be directly selected; at all other times, it requires the multi-step process described above.

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