[SERVER-34661] Return early when the vote request response has an error Created: 24/Apr/18 Updated: 29/Oct/23 Resolved: 23/May/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.16, 3.6.6, 4.0.0-rc1, 4.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Siyuan Zhou | Assignee: | Suganthi Mani |
| 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: |
v4.0
|
||||||||||||
| Sprint: | Repl 2018-05-21, Repl 2018-06-04 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
We should return earlier when the response of vote request is not ok rather than ignoring its status and assuming the term is present. |
| Comments |
| Comment by Githook User [ 23/May/18 ] | |||||||||||||||||||||
|
Author: {'username': 'smani87', 'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit e4e2162c489c1faa569463f51058ebc09368a5f9) | |||||||||||||||||||||
| Comment by Githook User [ 23/May/18 ] | |||||||||||||||||||||
|
Author: {'username': 'smani87', 'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit e4e2162c489c1faa569463f51058ebc09368a5f9) | |||||||||||||||||||||
| Comment by Githook User [ 23/May/18 ] | |||||||||||||||||||||
|
Author: {'username': 'smani87', 'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com'}Message: (cherry picked from commit e4e2162c489c1faa569463f51058ebc09368a5f9) | |||||||||||||||||||||
| Comment by Githook User [ 23/May/18 ] | |||||||||||||||||||||
|
Author: {'username': 'smani87', 'name': 'Suganthi Mani', 'email': 'suganthi.mani@mongodb.com'}Message: | |||||||||||||||||||||
| Comment by Siyuan Zhou [ 26/Apr/18 ] | |||||||||||||||||||||
|
A vote request to the old primary will force it to step down and vote yes, but the old primary fails to store the last vote.
The new primary receives an error response (ok: 0) which also has the expected fields, so it's considered a "yes" vote.
The last vote fails to store on the old primary because acquiring lock calls checkForInterruptNoAssert() which returns InterruptedDueToReplStateChange. The voter and candidate both need fixes, but the voter fix is critical. spencer, | |||||||||||||||||||||
| Comment by Spencer Brody (Inactive) [ 24/Apr/18 ] | |||||||||||||||||||||
|
Also voteResponse.initialize doesn't check the 'ok' field of the response. We should also getStatusFromCommandResponse(response.data) and make sure that the command didn't error before inspecting the other fields in the reply. |