summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/replsets/initial_sync4.js2
-rw-r--r--jstests/replsets/initial_sync_rename_collection.js7
-rw-r--r--jstests/replsets/initial_sync_rename_collection_unsafe.js7
3 files changed, 13 insertions, 3 deletions
diff --git a/jstests/replsets/initial_sync4.js b/jstests/replsets/initial_sync4.js
index 89b5f42f39a..504e7e737ab 100644
--- a/jstests/replsets/initial_sync4.js
+++ b/jstests/replsets/initial_sync4.js
@@ -34,7 +34,7 @@
var config = replTest.getReplSetConfig();
config.version = replTest.getReplSetConfigFromNode().version + 1;
- config.members.push({_id: 2, host: hostname + ":" + s.port, priority: 0});
+ config.members.push({_id: 2, host: hostname + ":" + s.port, priority: 0, votes: 0});
try {
m.getDB("admin").runCommand({replSetReconfig: config});
} catch (e) {
diff --git a/jstests/replsets/initial_sync_rename_collection.js b/jstests/replsets/initial_sync_rename_collection.js
index fdb77ea6da4..fa68297bf6c 100644
--- a/jstests/replsets/initial_sync_rename_collection.js
+++ b/jstests/replsets/initial_sync_rename_collection.js
@@ -27,7 +27,12 @@
jsTestLog('Bring up a new node');
const secondary = rst.add({setParameter: 'numInitialSyncAttempts=1'});
- rst.reInitiate();
+
+ jsTestLog('Begin initial sync on secondary');
+ let conf = rst.getPrimary().getDB('admin').runCommand({replSetGetConfig: 1}).config;
+ conf.members.push({_id: 1, host: secondary.host, priority: 0, votes: 0});
+ conf.version++;
+ assert.commandWorked(rst.getPrimary().getDB('admin').runCommand({replSetReconfig: conf}));
assert.eq(primary, rst.getPrimary(), 'Primary changed after reconfig');
jsTestLog('Wait for new node to start cloning');
diff --git a/jstests/replsets/initial_sync_rename_collection_unsafe.js b/jstests/replsets/initial_sync_rename_collection_unsafe.js
index 76cb8af38e0..dc8f6783e0c 100644
--- a/jstests/replsets/initial_sync_rename_collection_unsafe.js
+++ b/jstests/replsets/initial_sync_rename_collection_unsafe.js
@@ -25,7 +25,12 @@
const secondary = rst.add({setParameter: {allowUnsafeRenamesDuringInitialSync: true}});
assert.commandWorked(secondary.adminCommand(
{configureFailPoint: 'initialSyncHangBeforeCopyingDatabases', mode: 'alwaysOn'}));
- rst.reInitiate();
+
+ jsTestLog('Begin initial sync on secondary');
+ let conf = rst.getPrimary().getDB('admin').runCommand({replSetGetConfig: 1}).config;
+ conf.members.push({_id: 1, host: secondary.host, priority: 0, votes: 0});
+ conf.version++;
+ assert.commandWorked(rst.getPrimary().getDB('admin').runCommand({replSetReconfig: conf}));
assert.eq(primary, rst.getPrimary(), 'Primary changed after reconfig');
// Wait for fail point message to be logged.