Details
Description
Establish a snapshot timestamp if not provided via "atClusterTime" / "afterClusterTime" or by a previously stashed snapshot. In waitForReadConcern(), if readConcernLevel is snapshot, check whether getArgsPointInTime() returns boost::none, which signifies a snapshot time has yet to be established. If this is the case then we need to establish a replica set snapshot time:
- Wait for a majority committed snapshot to be available (in the same manner we do for majority read concern).
- Retrieve majority committed snapshot time via call to ReplicationCoordinator::getLastCommittedOpTime()::getTimeStamp().
- Register the snapshot timestamp with WiredTiger via call to opCtx->recoveryUnit()->selectSnapshot(), which is already in place for "atClusterTime".
Add handling for "atClusterTime" to waitForReadConcern():
- If the requested time is greater than the lastApplied time, trigger a noop write on the primary. Then wait for the majority commit point to become greater than or equal to the requested time.
- Begin the read transaction at the requested time.