The default ReadSource on a RecoveryUnit is kNone, which implies reads occur without a timestamp. In some cases, specifically for readers like FTDC which read without a timestamp, it is unknowable whether the ReadSource was left unset or set explicitly to kNone.
This would be useful in AutoGetCollectionForRead, where we check if ShouldNotConflictWithSecondaryBatchApplicationBlock is set. If it is, we implicitly assume the reader was willing to read without a timestamp, but this block can also get set when acquiring multiple different collection locks in the same scope. We should depend on information in the RecoveryUnit, not the Locker for whether or not to read with a timestamp.
This work can be either
- add a default enumeration state that is distinguishable from kNone
- make the field a boost::optional
Both options should read without a timestamp in WiredTigerRecoveryUnit.
- related to
-
SERVER-36006 `multiInitialSyncApply` should consider setting a read timestamp of `kNoTimestamp`
- Closed