[SERVER-27157] replSetRequestVotes doesn't synchronize between processing and recording request Created: 22/Nov/16 Updated: 05/Apr/17 Resolved: 18/Jan/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.12, 3.4.2, 3.5.2 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Mathias Stearn | Assignee: | Judah Schvimer |
| Resolution: | Done | 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.4, v3.2
|
||||||||||||||||||||||||
| Sprint: | Repl 2017-01-23 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
The command processes the vote request then stores it without any synchronization. This can lead to the following sequence:
Since we record votes using overwrite updates, the term 5 vote replaces the term 6 vote so we lose the fact that we already voted in term 6. Since we only read that document at startup, this can only result in conflicting votes if a shutdown occurs before we vote again. Unlike |
| Comments |
| Comment by Githook User [ 24/Jan/17 ] |
|
Author: {u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}Message: (cherry picked from commit 2369c1863931e5c7f671c33421416c9580f80626) |
| Comment by Githook User [ 20/Jan/17 ] |
|
Author: {u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}Message: (cherry picked from commit 2369c1863931e5c7f671c33421416c9580f80626) |
| Comment by Githook User [ 18/Jan/17 ] |
|
Author: {u'username': u'judahschvimer', u'name': u'Judah Schvimer', u'email': u'judah@mongodb.com'}Message: |
| Comment by Spencer Brody (Inactive) [ 04/Jan/17 ] |
|
I don't think its safe to change the behavior here without first adding test coverage that we actually use the last vote document correctly, otherwise we'll have no way of knowing if we've broken it. Thus I am marking |
| Comment by Judah Schvimer [ 30/Dec/16 ] |
|
We will add this synchronization by adding a predicate to the document update to only update the document if the new term is strictly greater than the old term. |