summaryrefslogtreecommitdiff
path: root/jstests/replsets/newly_added_with_user_reconfig.js
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2020-07-08 12:41:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-08 14:26:39 +0000
commit31db4f3c5a771356e765feb4a9798b6999bd1b54 (patch)
treec928280a7eff0bc7a6c66b3fe59e50ba1776f92e /jstests/replsets/newly_added_with_user_reconfig.js
parentc610e2627beeb3c8a6f95a2e7071a06e4ea1b1c0 (diff)
downloadmongo-31db4f3c5a771356e765feb4a9798b6999bd1b54.tar.gz
Revert "SERVER-46541 enable automatic reconfigs for initial sync semantics by default"
This reverts commit 76983a1c333c3c0ee563686d8d3643f7b5aa6f67.
Diffstat (limited to 'jstests/replsets/newly_added_with_user_reconfig.js')
-rw-r--r--jstests/replsets/newly_added_with_user_reconfig.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/jstests/replsets/newly_added_with_user_reconfig.js b/jstests/replsets/newly_added_with_user_reconfig.js
index b5530812a4d..d2d092110d4 100644
--- a/jstests/replsets/newly_added_with_user_reconfig.js
+++ b/jstests/replsets/newly_added_with_user_reconfig.js
@@ -16,8 +16,13 @@ const testName = jsTestName();
const dbName = "testdb";
const collName = "testcoll";
-const rst = new ReplSetTest(
- {name: testName, nodes: 1, settings: {chainingAllowed: false}, useBridge: true});
+const rst = new ReplSetTest({
+ name: testName,
+ nodes: 1,
+ nodeOptions: {setParameter: {enableAutomaticReconfig: true}},
+ settings: {chainingAllowed: false},
+ useBridge: true
+});
rst.startSet();
rst.initiateWithHighElectionTimeout();
@@ -25,6 +30,10 @@ const primary = rst.getPrimary();
const primaryDb = primary.getDB(dbName);
const primaryColl = primaryDb.getCollection(collName);
+// TODO (SERVER-46808): Move this into ReplSetTest.initiate
+waitForNewlyAddedRemovalForNodeToBeCommitted(primary, 0);
+waitForConfigReplication(primary, rst.nodes);
+
assert.commandWorked(primaryColl.insert({"starting": "doc"}));
jsTestLog("Adding a new node to the replica set");
@@ -33,6 +42,7 @@ const secondary = rst.add({
setParameter: {
'failpoint.initialSyncHangBeforeFinish': tojson({mode: 'alwaysOn'}),
'numInitialSyncAttempts': 1,
+ 'enableAutomaticReconfig': true,
}
});
rst.reInitiate();
@@ -133,11 +143,11 @@ assertVoteCount(primary, {
// Now try removing the member we added above.
jsTestLog("[4] Member removal, after initial sync");
-rst.remove(2);
config = rst.getReplSetConfigFromNode();
const twoNodeConfig = Object.assign({}, config);
twoNodeConfig.members = twoNodeConfig.members.slice(0, 2); // Remove the last node.
reconfig(rst, twoNodeConfig);
+rst.remove(2);
// Check 'newlyAdded' and vote counts.
assert(isMemberNewlyAdded(primary, 1));