-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Unknown
-
None
-
Affects Version/s: 3.12.10, 4.3.4
-
Component/s: Write Operations
How to Reproduce
- Do a replaceOne for a document and have the server return a NotWritablePrimary error.
- When the driver retries, have it hang waiting for write concern
- Kill (-9) the server being retried on.
- Error returned is com.mongodb.MongoNotPrimaryException, indicating the replace didn't happen, though in fact it may have.
If findOneAndReplace is used instead of replaceOne, a MongoSocketReadException is returned instead.