[SERVER-34682] Old primary should vote yes and store the last vote after stepdown on learning of a higher term Created: 26/Apr/18 Updated: 29/Oct/23 Resolved: 16/May/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.17, 3.6.6, 4.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Siyuan Zhou | Assignee: | William Schultz (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||
| Backport Requested: |
v3.6, v3.4
|
||||||||||||||||||||||||||||
| Sprint: | Repl 2018-05-21 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Linked BF Score: | 17 | ||||||||||||||||||||||||||||
| Description |
|
After stepdown, the old primary should store the last vote successfully even if the operation has been killed due to InterruptedDueToReplStateChange. The response should return { ok: 1 }. |
| Comments |
| Comment by Githook User [ 24/Jul/18 ] |
|
Author: {'username': 'will62794', 'name': 'William Schultz', 'email': 'william.schultz@mongodb.com'}Message: |
| Comment by Githook User [ 19/Jun/18 ] |
|
Author: {'username': 'will62794', 'name': 'William Schultz', 'email': 'william.schultz@mongodb.com'}Message: |
| Comment by William Schultz (Inactive) [ 11/Jun/18 ] |
|
Yep, that sounds appropriate to me. |
| Comment by Siyuan Zhou [ 17/May/18 ] |
|
william.schultz, I think this second part of your patch (asserting that the vote response is actually |
| Comment by Githook User [ 16/May/18 ] |
|
Author: {'email': 'william.schultz@mongodb.com', 'username': 'will62794', 'name': 'William Schultz'}Message: This patch allows a current primary to step down and cast its vote for a Additionally, this patch also asserts that the vote response is actually |
| Comment by William Schultz (Inactive) [ 10/May/18 ] |
|
To clarify, the issue is that we populate the response to a replSetRequestVote command here, then write down our vote to the LastVote document. The DB lock acquisition inside storeLocalLastVoteDocument method may get interrupted with InterruptedDueToReplStateChange, if we are currently in the process of stepping down. This will cause us to return a bad status from processReplSetRequestVotes, but the response will be populated as if we granted our vote. This will cause us to end up sending a response that contains an ok: 0 field but with a body that indicates we granted a "yes" vote i.e. voteGranted=true. |
| Comment by Siyuan Zhou [ 28/Apr/18 ] |
|
We want the new primary to get a vote from the old primary, so 2-node replset can finish an election quickly. The old primary steps down on receiving the higher term from the new one. |
| Comment by Spencer Brody (Inactive) [ 27/Apr/18 ] |
|
Why are you voting as part of stepping down? |