[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: |
|
||||
| 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. 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. |