-
Type:
Task
-
Resolution: Fixed
-
Priority:
Critical - P2
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
Context
The API `FindOneAndUpdate()` returns `ErrNoDocuments` (no documents in result) even when documents matching the match-filter exist on the cluster. This has been observed with mongodb versions 6, 7, 8 and 9. With mongodb version 9.0, the frequency of this behaviour has increased with server returning errors with NoWritesPerformed. This was reproduced in a load test with 9.0. Reproducing this with the previous versions has been non-trivial, however, this behaviour has been seen during production mongosync migrations.
For error traces, please see the attached files err_FindOneAndUpdate.txt and err_from_equivalent_RunCommand.txt
Definition of done
The driver must expose the underlying server error to the application layer appropriately so that the application can handle any retryable errors.
Pitfalls
The implementer must understand the semantics of server's findAndModify operation comprehensively - including scenarios like: multiple application threads issue FindOneAndUpdate() for the same document and with the same update.
- is fixed by
-
GODRIVER-4088 Database.RunCommand Returns Nil Error when command fails with NoWritesPerformed
-
- Closed
-