From 6883cdb23ea001e0164c69b0c8f800f5e71232c7 Mon Sep 17 00:00:00 2001 From: Jonathan Abrahams Date: Wed, 21 Feb 2018 14:23:08 -0500 Subject: SERVER-32688 FSM replication suites should give secondaries zero votes --- jstests/concurrency/fsm_libs/cluster.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'jstests') 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} -- cgit v1.2.1