-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Critical - P2
-
None
-
Component/s: CRUD & Command-Level Operations
-
None
-
Needed
-
Summary
The Read/Write Concern spec says drivers only SHOULD parse writeConcernError from server replies and report it. We should change this to MUST for helpers of commands that write.
A write concern error (WCE) usually arrives on an ok:1 reply, for example during a primary stepdown, a shutdown or a wtimeout. A driver that does not check for it returns success for a write whose durability was never confirmed, and does not retry it. This already caused data loss in the Rust driver: a findAndModify reply of ok:1 plus a retryable WCE was returned as success, and the write was rolled
back after the failover.
Note: All drivers report WCE except for some edge cases.
Motivation
Who is the affected end user?
Application developers who use MongoDB drivers with a replica set or sharded cluster and a write concern above `w:1`.
How does this affect the end user?
The driver reports success for a write that was not acknowledged at the requested durability level, or it does not retry a retryable error. The failure
shows up later as lost or inconsistent data, which is much harder to diagnose than an exception.
How likely is it that this problem or use case will occur?
- A WCE on an `ok:1` reply is produced by stepdown, shutdown, interruption, `wtimeout` and unsatisfiable or unknown
write concerns. - Primary stepdowns happen during maintenance, rolling upgrades and elections,
If the problem does occur, what are the consequences and how severe are they?
- Silent data loss. A write that the driver reports as successful can be rolled back after a failover (RUST-2479)
Is this issue urgent?
Does this ticket have a required timeline? What is it?
Is this ticket required by a downstream team?
No.
Is this ticket only for tests?
No.
Acceptance Criteria
Spec change + Tests
First Implementer: Rust
Second Implementer: C
- is related to
-
DRIVERS-2849 Add command monitoring expectations to retryable writes spec tests
-
- Backlog
-
- split to
-
CDRIVER-6523 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
CSHARP-6271 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
CXX-3608 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
GODRIVER-4196 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
JAVA-6345 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
NODE-7914 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
PHPLIB-1977 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
PYTHON-6181 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
RUBY-3986 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-
-
RUST-2527 Mandate raising writeConcernError (change SHOULD to MUST)
-
- Blocked
-