[SERVER-25765] Commands should wait for write concern even if they throw an exception Created: 23/Aug/16 Updated: 11/Jan/22 Resolved: 20/Apr/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.6, 3.5.7 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Spencer Brody (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | writeconcern | ||
| 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-02-13, Repl 2017-04-17, Repl 2017-05-08 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Discovered while working on Even when a command fails or results in a no-op, if that failure was due to the state of the data files at that moment, and the command came with a w:majority write concern, we need to wait for the most recent optime to become committed, so that the data that caused the command to error will be visible on a subsequent majority read. We already do this properly when a command returns a failure by returning false, but if the command throws an exception we don't. This can lead to subtle problems with the maintenance of the config server optime, as well as leading to confusing behavior for users using readConcern:majority reads |
| Comments |
| Comment by Githook User [ 16/Jun/17 ] |
|
Author: {u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}Message: (cherry picked from commit 5bdd2f49c02e5fe2812ccc6f21502799fa5a3268) |
| Comment by Githook User [ 20/Apr/17 ] |
|
Author: {u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}Message: |
| Comment by Spencer Brody (Inactive) [ 23/Aug/16 ] |
|
I think this should be as straightforward as moving the waiting for write concern code to be in an ON_BLOCK_EXIT set up right before running the command. |