summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-02-21 14:23:08 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2018-02-21 14:23:08 -0500
commit6883cdb23ea001e0164c69b0c8f800f5e71232c7 (patch)
tree8b333ba24304404bc5eb3cbb6c0b48bdaadc5769 /jstests/concurrency
parentcf546a4ca0e96fb3bf68d44115fcde9a274ca450 (diff)
downloadmongo-6883cdb23ea001e0164c69b0c8f800f5e71232c7.tar.gz
SERVER-32688 FSM replication suites should give secondaries zero votes
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_libs/cluster.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/jstests/concurrency/fsm_libs/cluster.js b/jstests/concurrency/fsm_libs/cluster.js
index 025f862a34d..750afa0e539 100644
--- a/jstests/concurrency/fsm_libs/cluster.js
+++ b/jstests/concurrency/fsm_libs/cluster.js
@@ -167,13 +167,14 @@ var Cluster = function(options) {
'Expected teardownFunctions.config to be an array of functions');
}
- function makeReplSetTestConfig(numReplSetNodes) {
+ function makeReplSetTestConfig(numReplSetNodes, firstNodeOnlyVote) {
const REPL_SET_VOTING_LIMIT = 7;
// Workaround for SERVER-26893 to specify when numReplSetNodes > REPL_SET_VOTING_LIMIT.
+ var firstNodeNotVoting = firstNodeOnlyVote ? 1 : REPL_SET_VOTING_LIMIT;
var rstConfig = [];
for (var i = 0; i < numReplSetNodes; i++) {
rstConfig[i] = {};
- if (i >= REPL_SET_VOTING_LIMIT) {
+ if (i >= firstNodeNotVoting) {
rstConfig[i].rsConfig = {priority: 0, votes: 0};
}
}
@@ -216,7 +217,8 @@ var Cluster = function(options) {
// TODO: allow 'options' to specify an 'rs' config
if (options.replication.enabled) {
shardConfig.rs = {
- nodes: makeReplSetTestConfig(options.replication.numNodes),
+ nodes: makeReplSetTestConfig(options.replication.numNodes,
+ !this.shouldPerformContinuousStepdowns()),
// Increase the oplog size (in MB) to prevent rollover
// during write-heavy workloads
oplogSize: 1024,
@@ -286,7 +288,8 @@ var Cluster = function(options) {
}
} else if (options.replication.enabled) {
var replSetConfig = {
- nodes: makeReplSetTestConfig(options.replication.numNodes),
+ nodes: makeReplSetTestConfig(options.replication.numNodes,
+ !this.shouldPerformContinuousStepdowns()),
// Increase the oplog size (in MB) to prevent rollover during write-heavy workloads
oplogSize: 1024,
nodeOptions: {verbose: verbosityLevel}