[SERVER-37065] Report ismaster:false in isMaster command response immediately upon learning of a new term Created: 10/Sep/18 Updated: 29/Oct/23 Resolved: 11/Dec/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.13, 4.1.7, 4.0.11 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||||||||||
| Sprint: | Repl 2018-12-17 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 18 | ||||||||||||||||||||
| Description |
|
Currently when a primary hears of a new term, it schedules work to take the global X lock and step down. Actually preventing new writes from being accepted requires changing the value of ReplicationCoordinatorImpl::_canAcceptNonLocalWrites, which requires the global X lock, so there's no way to stop accepting new writes any faster than we do currently. Filling out the response to an isMaster command, however, only requires the repl coord mutex, so we could be reporting ismaster:false as soon as we hear about a new term since at that point we know that we definitely are going to step down. This could stop new writes from being routed to us that are doomed to fail once the stepdown completes. |
| Comments |
| Comment by Githook User [ 31/May/19 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: (cherry picked from commit 89a64bec9cfe221200b1a47615e8a2bf6018f874) |
| Comment by Githook User [ 30/May/19 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: (cherry picked from commit 89a64bec9cfe221200b1a47615e8a2bf6018f874) |
| Comment by Githook User [ 12/Dec/18 ] |
|
Author: {'name': 'Siyuan Zhou', 'email': 'siyuan.zhou@mongodb.com', 'username': 'visualzhou'}Message: |
| Comment by Githook User [ 11/Dec/18 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}Message: |
| Comment by Spencer Brody (Inactive) [ 10/Sep/18 ] |
|
Changing this would mean that if an old primary participated in the election of a new primary, it would be guaranteed to report ismaster:false as soon as it voted for the new primary. |