Details
-
Bug
-
Resolution: Gone away
-
Major - P3
-
None
-
None
-
None
-
Replication
-
ALL
-
45
Description
In write_ops_exec.cpp, there is a class called LastOpsFixer, which sets the client's optime to the system time in the case of a failed or no-op write (e.g. a $set of a field to the value it is already set to).
As long as LastOpsFixer runs outside any WriteUnitOfWork (the normal case), this is fine. However, with sessions we can have a long-lived outer WUOW. In this case, if we have multiple operations, one of them can succeed and one can be a no-op. The successful operation will set the client optime to its optime on WUOW commit. The no-op will set the client optime to the system optime immediately.
If other operations happen in between the successful operation and the no-op, advancing the system optime, this results in the commit setting the client optime backwards (and hitting an invariant).
This currently happens only when writing in a snapshot read.