[SERVER-47097] Add isPrimary to ReplSetMetadata and use it for sync source selection Created: 24/Mar/20 Updated: 29/Oct/23 Resolved: 30/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||||||||||||||
| Sprint: | Repl 2020-04-06 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
Consider a secondary Node 0 syncing from a member, Node 1. When Node 0 executes TopologyCoordinator::shouldChangeSyncSource, it checks whether Node 1 thinks the primary has changed. Node 0 uses unsafe logic for this purpose: it checks the OplogQueryMetadata.currentPrimaryIndex it received from Node 1, but Node 0 doesn't know if it has the same config as Node 1 or not, so it doesn't know what member currentPrimaryIndex refers to. Fortunately, all that Node 0 needs to know when it executes TopologyCoordinator::shouldChangeSyncSource is whether Node 1 itself is the primary. Add an isPrimary field to ReplSetMetadata, and deprecate currentPrimaryIndex. Before closing this ticket, open another ticket to remove OplogQueryMetadata.currentPrimaryIndex in the next release. (Discovered during the |
| Comments |
| Comment by Githook User [ 30/Mar/20 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}Message: (cherry picked from commit d8acf3c44e41fd4423caf8a337264a6dac86b8c5) |
| Comment by Githook User [ 30/Mar/20 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}Message: (cherry picked from commit 0ebbedb45382c922d4873c2689d67fd80a735e5c) |
| Comment by Githook User [ 30/Mar/20 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |
| Comment by Githook User [ 27/Mar/20 ] |
|
Author: {'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}Message: |