summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVesselina Ratcheva <vesselina.ratcheva@10gen.com>2021-10-28 18:11:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-28 18:32:46 +0000
commit4c689d6ec00a0664ce56b87e305eb1af0d7a3f7f (patch)
tree88c1a4cbf5412cd0cc43ff853f135d792ca531c1
parent89334bcd6bf5556e894f1404f6c809dd3d9d8cc0 (diff)
downloadmongo-4c689d6ec00a0664ce56b87e305eb1af0d7a3f7f.tar.gz
SERVER-56096 Remove replication recovery invariant that stableTimestamp equals appliedThrough
-rw-r--r--src/mongo/db/repl/replication_recovery.cpp6
-rw-r--r--src/mongo/db/repl/replication_recovery_test.cpp27
2 files changed, 0 insertions, 33 deletions
diff --git a/src/mongo/db/repl/replication_recovery.cpp b/src/mongo/db/repl/replication_recovery.cpp
index ac5c00d9aed..757ce337b20 100644
--- a/src/mongo/db/repl/replication_recovery.cpp
+++ b/src/mongo/db/repl/replication_recovery.cpp
@@ -420,12 +420,6 @@ void ReplicationRecoveryImpl::recoverFromOplog(OperationContext* opCtx,
}
const auto appliedThrough = _consistencyMarkers->getAppliedThrough(opCtx);
- invariant(!stableTimestamp || stableTimestamp->isNull() || appliedThrough.isNull() ||
- *stableTimestamp == appliedThrough.getTimestamp(),
- str::stream() << "Stable timestamp " << stableTimestamp->toString()
- << " does not equal appliedThrough timestamp "
- << appliedThrough.toString());
-
if (stableTimestamp) {
invariant(supportsRecoveryTimestamp);
const auto recoveryMode = isRollbackRecovery ? RecoveryMode::kRollbackFromStableTimestamp
diff --git a/src/mongo/db/repl/replication_recovery_test.cpp b/src/mongo/db/repl/replication_recovery_test.cpp
index 618b344fb8c..1d110da4e14 100644
--- a/src/mongo/db/repl/replication_recovery_test.cpp
+++ b/src/mongo/db/repl/replication_recovery_test.cpp
@@ -616,20 +616,6 @@ TEST_F(ReplicationRecoveryTest,
testRecoveryToStableAppliesDocumentsWithNoAppliedThrough(false);
}
-DEATH_TEST_F(ReplicationRecoveryTest,
- RecoveryFailsWithUnmatchedAppliedThrough,
- "Invariant failure") {
- ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
- auto opCtx = getOperationContext();
-
- _setUpOplog(opCtx, getStorageInterface(), {1, 2, 3, 4, 5});
-
- auto appliedThroughTS = Timestamp(4, 4);
- getConsistencyMarkers()->setAppliedThrough(opCtx, OpTime(appliedThroughTS, 1));
- getStorageInterfaceRecovery()->setRecoveryTimestamp(Timestamp(2, 2));
- recovery.recoverFromOplog(opCtx, boost::none);
-}
-
TEST_F(ReplicationRecoveryTest, RecoveryIgnoresDroppedCollections) {
ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
auto opCtx = getOperationContext();
@@ -754,19 +740,6 @@ TEST_F(ReplicationRecoveryTest, RecoveryDoesNotApplyOperationsIfAppliedThroughIs
ASSERT_EQ(OpTime(Timestamp(5, 5), 1), getConsistencyMarkers()->getAppliedThrough(opCtx));
}
-DEATH_TEST_F(ReplicationRecoveryTest,
- RecoveryInvariantsWithUnequalStableTimestampAndAppliedThrough,
- "Invariant failure") {
- ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
- auto opCtx = getOperationContext();
-
- _setUpOplog(opCtx, getStorageInterface(), {5});
-
- getConsistencyMarkers()->setAppliedThrough(opCtx, OpTime(Timestamp(3, 3), 1));
-
- recovery.recoverFromOplog(opCtx, Timestamp(4, 4));
-}
-
TEST_F(ReplicationRecoveryTest, RecoveryAppliesUpdatesIdempotently) {
ReplicationRecoveryImpl recovery(getStorageInterface(), getConsistencyMarkers());
auto opCtx = getOperationContext();