Details
Description
Set up a mocked-up objects for testing replica-set causal consistent reads.
The fixture should provide the following functionality:
- set LogicalClock
- write to an opLog
- read from an opLog
- write to secondary and primary nodes (separately by setting repl coordinator mode)
- read from the secondary and primary nodes
- clocksource skew
- disable/enable readConcernMajority
Implementation:
- Use existing LogicalClockTest class can be used as a base, inherit from ShardingMongodTestFixture
- override setUp to
a) set up logicalClock on serviceContext
b) add a clockSource mock
c) add a keyManager mock
- Integrate functionality from logical_clock_test.cpp and reuse the new fixture there.
- Add one test that causes a write to opLog and check that the result matches the current clusterTime - may be using get lastAppliedOptime() method of replicationCoordinator