diff options
author | Dianna Hohensee <dianna.hohensee@mongodb.com> | 2020-02-26 13:14:49 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-27 13:54:12 +0000 |
commit | 3a59e217a4b34234acbd6a404f98276a87435ee0 (patch) | |
tree | 0e0890c6e5bd0db9d962b694acf0f3ee5edb19b5 /src | |
parent | 77c6d1044cff7b113881a1c97f5dca63567fbe81 (diff) | |
download | mongo-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')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 6 |
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)); |