[SERVER-29606] Implement failpoint to aid testing retryable writes Created: 13/Jun/17 Updated: 30/Oct/23 Resolved: 14/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | Kaloian Manassiev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Sharding 2017-10-02 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
As requested in the retryable writes driver spec, a failpoint that triggers the server to close a socket after applying a write operation will be helpful for testing retryable writes. Drivers will only attempt to retry writes if they encounter a network error, so having a failpoint return a failure result for the write command would not be sufficient. |
| Comments |
| Comment by Ramon Fernandez Marina [ 14/Sep/17 ] | |||||||
|
Author: {'username': u'kaloianm', 'name': u'Kaloian Manassiev', 'email': u'kaloian.manassiev@mongodb.com'}Message: | |||||||
| Comment by Ramon Fernandez Marina [ 14/Sep/17 ] | |||||||
|
Author: {'username': u'kaloianm', 'name': u'Kaloian Manassiev', 'email': u'kaloian.manassiev@mongodb.com'}Message: This option allows the failpoint's effect to be skipped for up to a | |||||||
| Comment by A. Jesse Jiryu Davis [ 13/Sep/17 ] | |||||||
|
Looks great, thanks! | |||||||
| Comment by Kaloian Manassiev [ 13/Sep/17 ] | |||||||
|
For our internal testing we needed a little bit more elaborate failpoint so instead of disconnectAfterWrite I implemented a more generic onPrimaryTransactionalWrite one with the following parameters which can be specified through the data:
jmikola, jesse, jeff.yemin: I believe this will suit your needs for driver testing as well, but let me know if you have any problems with it. | |||||||
| Comment by Jeremy Mikola [ 24/Jul/17 ] | |||||||
|
In mongodb/specifications#156, jeff.yemin highlighted a need to test retryable behavior from a failed write command in the middle of a split batch (e.g. insertMany() with several 8MB documents split into a series of insert commands). This will require the fail point to support a skip option to defer triggering on the first X commands. For example:
The insertMany() operation would be split into three insert commands and the fail point will trigger on the third and final command in the sequence. With a skip option, we can only test retryable behavior for the first insert command in the sequence. Is this functionality we can expect for the fail point? If not, I'm open to another proposal that would allow the above test case to be exercised. | |||||||
| Comment by Jeremy Mikola [ 20/Jun/17 ] | |||||||
|
We're currently prototyping driver tests for retryable writes in mongodb/specifications#156 and are expecting the following API:
|