[JAVA-4244] Top level error labels aren't added to WriteConcernErrors Created: 19/Jul/21 Updated: 28/Oct/23 Resolved: 27/Jul/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1, 3.12.10 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | planned-maintenance-detectable-bug | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||||||||||
| Description |
|
The ProtocolHelper#createSpecialException does not apply top level error labels to the write concern error. This can wrongly lead to errors being deemed not retryable. In particular, it means a response to a write operation like:
will not be considered by the driver to be retryable. The retryable writes spec states here that:
So it seems the driver is in violation of that mandate, and it seems that there are no spec tests enforcing it or the driver has implemented the spec tests incorrectly so that they pass when they should not. |
| Comments |
| Comment by Githook User [ 27/Jul/21 ] | ||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Add top-level error labels to write concern error (#766) This will allow the driver to properly retry writes that the server
| ||||||||||||||||||
| Comment by Githook User [ 27/Jul/21 ] | ||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Add top-level error labels to write concern error (#766) This will allow the driver to properly retry writes that the server
| ||||||||||||||||||
| Comment by Githook User [ 27/Jul/21 ] | ||||||||||||||||||
|
Author: {'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}Message: Add top-level error labels to write concern error (#766) This will allow the driver to properly retry writes that the server
| ||||||||||||||||||
| Comment by Jeffrey Yemin [ 22/Jul/21 ] | ||||||||||||||||||
|
This bug would have been caught by DRIVERS-1385. | ||||||||||||||||||
| Comment by Jeffrey Yemin [ 22/Jul/21 ] | ||||||||||||||||||
|
I confirmed that there are no spec tests that enforce that drivers check for error labels at the top level when encountering a write concern error. All the tests use failpoints that look something like this:
where the error label is embedded in the write concern error and not at the top level. |