diff --git a/jstests/replsets/disallow_adding_initialized_node1.js b/jstests/replsets/disallow_adding_initialized_node1.js index d9b953d874a..4773c4031bd 100644 --- a/jstests/replsets/disallow_adding_initialized_node1.js +++ b/jstests/replsets/disallow_adding_initialized_node1.js @@ -38,6 +38,11 @@ jsTestLog('Replica set A ID = ' + configA.settings.replicaSetId); jsTestLog('Replica set B ID = ' + configB.settings.replicaSetId); assert.neq(configA.settings.replicaSetId, configB.settings.replicaSetId); +// Increment the config version first on this node so that its version on the next reconfig will +// be higher than B's. +configA.version++; +assert.commandWorked(primaryA.adminCommand({replSetReconfig: configA})); + jsTestLog("Adding replica set B's primary " + primaryB.host + " to replica set A's config"); configA.version++; configA.members.push({_id: 11, host: primaryB.host});