-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Critical - P2
-
None
-
Affects Version/s: 3.0.0-rc9
-
Component/s: Querying
-
None
-
ALL
-
After a coupe of days lost troubleshooting a race condition on our end, we determined MongoDB r3.0.0-rc6/rc9 has issues with concurrent findAndModify writes. Specifically we have business logic that acquires a lease (think: lock) on a given object for a few minutes, for processing. The find and modify sets the lease datetime in the present and the query makes sure it's at least three minutes in the past.
We found MongoDB 3.0 acquires the same object and modifies it twice, within a matter of milliseconds, having a TOCTOU (time-of-check time-of-use) condition. We are able to reproduce consistently on a threaded environment with several queries going out at the same time.
We initially suspected the following issue was the culptrit, but it doesn't seem like it was fixed 100%:
SERVER-17132
https://github.com/mongodb/mongo/commit/1c3f32bedac9a9277b7088f83848fe577526b6da
Unfortunately we still see findAndModify returning objects that were modified by a previous findAndModify statement and no longer fullfil the query predicate due to a concurrent update.
- is related to
-
SERVER-17132 Index contains extra entries
- Closed