[SERVER-77616] findOneAndUpdate with no-op update does not seem to work against stale reads Created: 31/May/23 Updated: 08/Jan/24 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.0.18 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Peter Ivanov | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | documentation, transactions | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Server Triage
|
| Operating System: | ALL |
| Steps To Reproduce: | There's no code snippet at this point, but the idea is:
And if we change the step 2 so that findOneAndUpdate actually changes the document, step 4 works as intended, and one of the transactions fails. |
| Participants: |
| Description |
|
The's this part of a documentation: However, when we tried to use this trick, it only proved to be working as intended if the update actually changes something in the document. Otherwise, despite being used exactly as in the example, such operation did not, in the test scenario, trigger a write conflict that would trigger a retry for a transaction.
Could some other factors be relevant which are absent from the documentation? I'm willing to provide as full a context as I can. |