summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2018-05-08 14:53:49 -0400
committerJudah Schvimer <judah@mongodb.com>2018-05-15 13:59:11 -0400
commit689d52131f6ac1a446fe1b93647b11d0329c629c (patch)
tree42b715f59ee4b402ac12fad10c2e8ebc59fbe9ee /src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp
parent6d2de545a7cfcf4ab23dcf73426a1d50896d6d0c (diff)
downloadmongo-689d52131f6ac1a446fe1b93647b11d0329c629c.tar.gz
SERVER-34895 only set stable timestamp to timestamps in oplog
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp')
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp
index df475771ed0..388c465e69d 100644
--- a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp
@@ -134,8 +134,8 @@ TEST_F(ReplCoordTest, ElectionSucceedsWhenNodeIsTheOnlyElectableNode) {
ASSERT(getReplCoord()->getMemberState().secondary())
<< getReplCoord()->getMemberState().toString();
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 1), 0));
auto electionTimeoutWhen = getReplCoord()->getElectionTimeout_forTest();
ASSERT_NOT_EQUALS(Date_t(), electionTimeoutWhen);
@@ -198,8 +198,8 @@ TEST_F(ReplCoordTest, StartElectionDoesNotStartAnElectionWhenNodeIsRecovering) {
ASSERT(getReplCoord()->getMemberState().recovering())
<< getReplCoord()->getMemberState().toString();
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 1), 0));
simulateEnoughHeartbeatsForAllNodesUp();
auto electionTimeoutWhen = getReplCoord()->getElectionTimeout_forTest();
@@ -219,8 +219,8 @@ TEST_F(ReplCoordTest, ElectionSucceedsWhenNodeIsTheOnlyNode) {
<< 1),
HostAndPort("node1", 12345));
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(10, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(10, 1), 0));
ASSERT_OK(getReplCoord()->setFollowerMode(MemberState::RS_SECONDARY));
getReplCoord()->waitForElectionFinish_forTest();
ASSERT(getReplCoord()->getMemberState().primary())
@@ -464,8 +464,8 @@ TEST_F(ReplCoordTest, NodeWillNotStandForElectionDuringHeartbeatReconfig) {
<< 1),
HostAndPort("node1", 12345));
ASSERT_OK(getReplCoord()->setFollowerMode(MemberState::RS_SECONDARY));
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 1), 0));
getGlobalFailPointRegistry()
->getFailPoint("blockHeartbeatReconfigFinish")
@@ -1927,9 +1927,9 @@ TEST_F(TakeoverTest, DontCallForPriorityTakeoverWhenLaggedDifferentSecond) {
auto now = getNet()->now();
OperationContextNoop opCtx;
- OpTime currentOpTime(Timestamp(100, 0), 0);
- OpTime behindOpTime(Timestamp(97, 0), 0);
- OpTime closeEnoughOpTime(Timestamp(98, 0), 0);
+ OpTime currentOpTime(Timestamp(100, 1), 0);
+ OpTime behindOpTime(Timestamp(97, 1), 0);
+ OpTime closeEnoughOpTime(Timestamp(98, 1), 0);
replCoord->setMyLastAppliedOpTime(behindOpTime);
replCoord->setMyLastDurableOpTime(behindOpTime);
@@ -1999,8 +1999,8 @@ TEST_F(ReplCoordTest, NodeCancelsElectionUponReceivingANewConfigDuringDryRun) {
<< BSON("heartbeatIntervalMillis" << 100)),
HostAndPort("node1", 12345));
ASSERT_OK(getReplCoord()->setFollowerMode(MemberState::RS_SECONDARY));
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 1), 0));
simulateEnoughHeartbeatsForAllNodesUp();
// Advance to dry run vote request phase.
@@ -2064,8 +2064,8 @@ TEST_F(ReplCoordTest, NodeCancelsElectionUponReceivingANewConfigDuringVotePhase)
<< BSON("heartbeatIntervalMillis" << 100)),
HostAndPort("node1", 12345));
ASSERT_OK(getReplCoord()->setFollowerMode(MemberState::RS_SECONDARY));
- getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 0), 0));
- getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 0), 0));
+ getReplCoord()->setMyLastAppliedOpTime(OpTime(Timestamp(100, 1), 0));
+ getReplCoord()->setMyLastDurableOpTime(OpTime(Timestamp(100, 1), 0));
simulateEnoughHeartbeatsForAllNodesUp();
simulateSuccessfulDryRun();
ASSERT(TopologyCoordinator::Role::kCandidate == getTopoCoord().getRole());