Validate that the operationTime value depends on the read/writeConcern of the read or write command that produced it:
- read with readConcern level majority: operationTime is the logical time of the last op in the oplog, in the snapshot blessed as ‘committed’.
start standalone RS, issue a w:majority write, read operationTime OT1 from the result,
pause the secondary replication using a failpoint,
issue another w:1 write and get the operationTime OT2.
Validate that read with readConcern: {level:majority, afterClusterTime: OT1}returns the data from write 1 and the operationTime in the response is OT1
- read with readConcern level local: operationTime is the logical time of the last op in the oplog.
check that it is not supported (as of now)
- write with writeConcern majority: operationTime is the logical time of the write (if successful) or the previous successful write at the time the write was determined to have failed or a no-op.
start standalone RS, issue a w:majority write, read operationTime OT1 from the result,
pause the secondary replication using a failpoint,
issue another a write that will fail (e.g _id that is duplicates the previous insert)
read operationTime OT2 from the response and validate that OT2 == OT1