summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_coordinator_impl.cpp
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@mongodb.com>2020-02-26 13:14:49 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-27 13:54:12 +0000
commit3a59e217a4b34234acbd6a404f98276a87435ee0 (patch)
tree0e0890c6e5bd0db9d962b694acf0f3ee5edb19b5 /src/mongo/db/repl/replication_coordinator_impl.cpp
parent77c6d1044cff7b113881a1c97f5dca63567fbe81 (diff)
downloadmongo-3a59e217a4b34234acbd6a404f98276a87435ee0.tar.gz
SERVER-41386 Test that the replica set's majority commit point can move forward because of secondaries without primary durable writes
SERVER-41387 Test that oplogTruncateAfterPoint will clear oplog holes during startup recovery after primary crash create mode 100644 jstests/noPassthrough/non_durable_writes_on_primary_can_reach_majority.js create mode 100644 jstests/noPassthrough/startup_recovery_truncates_oplog_holes_after_primary_crash.js
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl.cpp')
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index ec92dcfc2e2..f3a605dbd75 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -114,6 +114,7 @@ MONGO_FAIL_POINT_DEFINE(forceSyncSourceRetryWaitForInitialSync);
MONGO_FAIL_POINT_DEFINE(waitForIsMasterResponse);
// Will cause an isMaster request to hang as it starts waiting.
MONGO_FAIL_POINT_DEFINE(hangWhileWaitingForIsMasterResponse);
+MONGO_FAIL_POINT_DEFINE(skipDurableTimestampUpdates);
// Number of times we tried to go live as a secondary.
Counter64 attemptsToBecomeSecondary;
@@ -1196,6 +1197,11 @@ void ReplicationCoordinatorImpl::setMyLastAppliedOpTimeAndWallTimeForward(
void ReplicationCoordinatorImpl::setMyLastDurableOpTimeAndWallTimeForward(
const OpTimeAndWallTime& opTimeAndWallTime) {
stdx::unique_lock<Latch> lock(_mutex);
+
+ if (MONGO_unlikely(skipDurableTimestampUpdates.shouldFail())) {
+ return;
+ }
+
if (opTimeAndWallTime.opTime > _getMyLastDurableOpTime_inlock()) {
_setMyLastDurableOpTimeAndWallTime(lock, opTimeAndWallTime, false);
_reportUpstream_inlock(std::move(lock));