diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2020-02-19 16:23:13 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-20 23:37:51 +0000 |
commit | 830fbc2939c577f0904ba1202c1eca9d8e921c54 (patch) | |
tree | 8a718a578d753f68203b0c8924a27bf104784344 /src/mongo/db/repl/replication_coordinator_test_fixture.cpp | |
parent | e4571070e9659a1ff9335eb0382a6fa0d611bfcf (diff) | |
download | mongo-830fbc2939c577f0904ba1202c1eca9d8e921c54.tar.gz |
SERVER-46257: OplogFetcher should run LogicalTimeMetadataHook on DBClientConnection
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_test_fixture.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_test_fixture.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp index 4d2c4c82dd4..5aa9fd122d5 100644 --- a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp +++ b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp @@ -506,5 +506,22 @@ void ReplCoordTest::simulateCatchUpAbort() { net->exitNetwork(); } +void ReplCoordTest::replCoordAdvanceCommitPoint(const OpTime& opTime, + Date_t wallTime, + bool fromSyncSource) { + if (wallTime == Date_t()) { + wallTime = Date_t() + Seconds(opTime.getSecs()); + } + getExternalState()->setGlobalTimestamp(getGlobalServiceContext(), opTime.getTimestamp()); + getReplCoord()->advanceCommitPoint({opTime, wallTime}, fromSyncSource); +} + +void ReplCoordTest::replCoordAdvanceCommitPoint(const OpTimeAndWallTime& opTimeAndWallTime, + bool fromSyncSource) { + getExternalState()->setGlobalTimestamp(getGlobalServiceContext(), + opTimeAndWallTime.opTime.getTimestamp()); + getReplCoord()->advanceCommitPoint(opTimeAndWallTime, fromSyncSource); +} + } // namespace repl } // namespace mongo |