-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Description of Drivers Ticket:
MongoDB 4.4 introduces a new "provenance" field to write concern errors, which describes the origin of the write concern associated with the error. For example:
"writeConcernError" : { "code" : 64, "codeName" : "WriteConcernFailed", "errmsg" : "waiting for replication timed out", "errInfo" : { "wtimeout" : true, "writeConcern" : { "w" : 2, "wtimeout" : 1000, "provenance" : "clientSupplied" } } }
Though drivers should not parse the "errInfo" field of a writeConcernError, drivers must ensure that the provenance field is accessible to users so that developers/admins can be aware of situations such as custom write concern defaults causing wtimeouts, etc.
SPEC-1578 makes explicit how a WriteConcernError should be constructed from a server reply. Drivers need to validate (or update if necessary) the logic for constructing WriteConcernError, and implement a new prose test to validate a "provenance" is accessible from a WriteConcernError.
See DRIVERS-967 for updated details.