summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-05-30 14:27:27 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2018-05-30 14:27:27 -0400
commit4ab52cb8bc6078e07de1a9cbb7e1326f2d9ffe87 (patch)
tree0766ee0fdcc9b33234c03e515497269cebede96d
parentcd0266e8c63dae2722487c434d8a524b62a8a619 (diff)
downloadmongo-4ab52cb8bc6078e07de1a9cbb7e1326f2d9ffe87.tar.gz
SERVER-32688 FSM replication suites should give secondaries zero votes
-rw-r--r--jstests/concurrency/fsm_libs/cluster.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jstests/concurrency/fsm_libs/cluster.js b/jstests/concurrency/fsm_libs/cluster.js
index 609211d7894..1e23eb88b2e 100644
--- a/jstests/concurrency/fsm_libs/cluster.js
+++ b/jstests/concurrency/fsm_libs/cluster.js
@@ -161,13 +161,14 @@ var Cluster = function(options) {
"Both 'masterSlave' and 'sharded.enabled' cannot" + "be true");
}
- function makeReplSetTestConfig(numReplSetNodes) {
+ function makeReplSetTestConfig(numReplSetNodes, firstNodeOnlyVote=true) {
const REPL_SET_VOTING_LIMIT = 7;
+ var firstNodeNotVoting = firstNodeOnlyVote ? 1 : REPL_SET_VOTING_LIMIT;
// Workaround for SERVER-26893 to specify when numReplSetNodes > 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};
}
}