summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2019-04-19 15:16:06 -0400
committerMaria van Keulen <maria@mongodb.com>2019-05-01 17:28:25 -0400
commit6693d9fc93d2105da44a6abb5a2aa2bb72154eeb (patch)
tree8945ad69e67d61ed5df2df7788626ab632da02aa /src/mongo/dbtests
parent1ecca97a8852223856671eaf6077da94203b258b (diff)
downloadmongo-6693d9fc93d2105da44a6abb5a2aa2bb72154eeb.tar.gz
SERVER-39868 Avoid throttling replica set elections
This patch also ensures secondaries are not throttled and provides a framework to exclude particular operations from being throttled.
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r--src/mongo/dbtests/replica_set_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/dbtests/replica_set_tests.cpp b/src/mongo/dbtests/replica_set_tests.cpp
index b04f4f066f6..34d8145606d 100644
--- a/src/mongo/dbtests/replica_set_tests.cpp
+++ b/src/mongo/dbtests/replica_set_tests.cpp
@@ -96,6 +96,8 @@ private:
TEST_F(ReplicaSetTest, ReplCoordExternalStateStoresLastVoteWithNewTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})
@@ -117,6 +119,8 @@ TEST_F(ReplicaSetTest, ReplCoordExternalStateStoresLastVoteWithNewTerm) {
TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithOldTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})
@@ -138,6 +142,8 @@ TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithOldTerm) {
TEST_F(ReplicaSetTest, ReplCoordExternalStateDoesNotStoreLastVoteWithEqualTerm) {
auto opCtx = makeOpCtx();
+ // Methods that do writes as part of elections expect Flow Control to be disabled.
+ opCtx->setShouldParticipateInFlowControl(false);
auto replCoordExternalState = getReplCoordExternalState();
replCoordExternalState->storeLocalLastVoteDocument(opCtx.get(), repl::LastVote{2, 1})