summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_coordinator_test_fixture.cpp
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2020-02-19 16:23:13 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-20 23:37:51 +0000
commit830fbc2939c577f0904ba1202c1eca9d8e921c54 (patch)
tree8a718a578d753f68203b0c8924a27bf104784344 /src/mongo/db/repl/replication_coordinator_test_fixture.cpp
parente4571070e9659a1ff9335eb0382a6fa0d611bfcf (diff)
downloadmongo-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.cpp17
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