diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2016-11-17 20:06:38 -0500 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2016-11-17 20:07:41 -0500 |
commit | cf4d9f77e5bcb609272721bc87b03a795fa21b1f (patch) | |
tree | 7d14e45a56da90b3134599d333c525e7f8851756 /src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp | |
parent | c7ebfd0fd292e45256e9799a2a96ed6054ecc357 (diff) | |
download | mongo-cf4d9f77e5bcb609272721bc87b03a795fa21b1f.tar.gz |
Revert "SERVER-26403 Clean primary states on stepdown"r3.4.0-rc4
This reverts commit 6904d0ac5ea4bba1822103eb4e7a623cc81de641.
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.cpp | 10 |
1 files changed, 6 insertions, 4 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 23b9df8e219..7bbe9000bc7 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 @@ -1348,12 +1348,11 @@ TEST_F(PrimaryCatchUpTest, PrimaryStepsDownDuringFreshnessScan) { ASSERT_TRUE(evh.isValid()); getReplExec()->waitForEvent(evh); ASSERT_TRUE(getReplCoord()->getMemberState().secondary()); - ASSERT_FALSE(getReplCoord()->isCatchingUp()); - ASSERT_FALSE(getReplCoord()->isWaitingForApplierToDrain()); auto net = getNet(); net->enterNetwork(); net->runUntil(net->now() + config.getCatchUpTimeoutPeriod()); net->exitNetwork(); + ASSERT_FALSE(getReplCoord()->isWaitingForApplierToDrain()); stopCapturingLogMessages(); ASSERT_EQUALS(1, countLogLinesContaining("Stopped transition to primary")); ASSERT_FALSE(getReplCoord()->canAcceptWritesForDatabase("test")); @@ -1378,12 +1377,15 @@ TEST_F(PrimaryCatchUpTest, PrimaryStepsDownDuringCatchUp) { ASSERT_TRUE(evh.isValid()); getReplExec()->waitForEvent(evh); ASSERT_TRUE(getReplCoord()->getMemberState().secondary()); - ASSERT_FALSE(getReplCoord()->isCatchingUp()); - ASSERT_FALSE(getReplCoord()->isWaitingForApplierToDrain()); auto net = getNet(); net->enterNetwork(); net->runReadyNetworkOperations(); net->exitNetwork(); + auto txn = makeOperationContext(); + // Simulate bgsync signaling replCoord to exit drain mode. + // At this point, we see the stepdown and reset the states. + getReplCoord()->signalDrainComplete(txn.get()); + ASSERT_FALSE(getReplCoord()->isWaitingForApplierToDrain()); stopCapturingLogMessages(); ASSERT_EQUALS(1, countLogLinesContaining("Cannot catch up oplog after becoming primary")); ASSERT_FALSE(getReplCoord()->canAcceptWritesForDatabase("test")); |