-
Type: Investigation
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Not Needed
-
Developer Tools
We are changing the name of the error WriteConcernFailed to WriteConcernTimeout to more accurately reflect what it means. Neither the error code nor the error categories are changing.
Link to WriteConcernFailed: https://github.com/10gen/mongo/blob/842771d8ed692173b3911ca614ffe5dedbeb3d2a/src/mongo/base/error_codes.yml#L111
From the code perspective, we expect that error codes are checked, not error names / labels. Code that currently checks for WriteConcernFailed rather than error code 64 will fail.
From the docs perspective, we should no longer reference WriteConcernFailed; it should be replaced with WriteConcernTimeout.
Description of Linked Ticket
Almost all of the usages of WriteConcernFailed today are cases where waiting for write concern timed out. It's worth considering changing this code name to better reflect that.
The only usage we found that isn't for a timeout purpose is on mongos where it is used to combine multiple write concern errors into one. That should maybe have its own error type or we should instead just return one of the errors instead of treating this case specially, in the spirit of this comment, regarding a similar situation where we return MultipleErrorsOccurred when we get multiple write errors.
I believe drivers should only be checking error codes and labels, not error code names, so I don't think this would present an issue for them.
See comment for some additional context from Slack discussion.
- depends on
-
SERVER-94813 Consider changing WriteConcernFailed code name to WriteConcernTimedOut
- Closed