From 830fbc2939c577f0904ba1202c1eca9d8e921c54 Mon Sep 17 00:00:00 2001 From: Lingzhi Deng Date: Wed, 19 Feb 2020 16:23:13 -0500 Subject: SERVER-46257: OplogFetcher should run LogicalTimeMetadataHook on DBClientConnection --- .../db/repl/replication_coordinator_test_fixture.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mongo/db/repl/replication_coordinator_test_fixture.cpp') 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 -- cgit v1.2.1