[SERVER-34156] Consolidate to a single replication API method for checking if a replica set is being used Created: 27/Mar/18 Updated: 29/Oct/23 Resolved: 21/Jul/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Kaitlin Mahar |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | former-quick-wins, master-slave, repl-shortlist | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Replication
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Repl 2020-06-29, Repl 2023-07-24 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
ReplSettings::usingReplsets(), ReplicationCoordinator::isReplEnabled(), and ReplicationCoordinator::getReplicationMode() all return the same info and so it is confusing to have separate methods and engineers are not sure which to use. |
| Comments |
| Comment by Githook User [ 21/Jul/23 ] |
|
Author: {'name': 'Kaitlin Mahar', 'email': 'kaitlin.mahar@mongodb.com', 'username': 'kmahar'}Message: |
| Comment by Didier Nadeau [ 05/Jun/23 ] |
|
There are two interfaces to get the repl settings : getGlobalReplSettings and ReplicationCoordinator::getSettings. We should decide which interface should be used and remove the other (if we can't due to a corner case, we should make it very clear this interface should only be used under precise circumstances). |
| Comment by Frederic Vitzikam [ 30/May/23 ] |
|
There is at least one place where we check for replMode == repl::ReplicationCoordinator::modeReplSet inside a if(replMode != repl::ReplicationCoordinator::modeNone) which is redundant now : https://github.com/10gen/mongo/blob/master/src/mongo/db/commands/write_commands.cpp#L196 |
| Comment by Judah Schvimer [ 27/Mar/18 ] |
|
There are also some places that call getReplicationMode() explicitly, which is a third way of checking the same thing. |