Files
mongo/jstests/replsets/reconfig_commitment_succeeds_with_arbiter.js
Steve McClure 1ffbc6c2e9 SERVER-109432: Autofix JS var usage to favor let (#40637)
GitOrigin-RevId: 9674b7db36a0f3f650d39c1e3fb2ad6ff2141cfb
2025-08-28 19:21:01 +00:00

31 lines
812 B
JavaScript

/**
* Verify that a non force replica set reconfig can be committed by a primary and arbiter, with a
* secondary down.
*/
import {ReplSetTest} from "jstests/libs/replsettest.js";
// Make the secondary unelectable.
let rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0}}, {rsConfig: {arbiterOnly: true}}]});
rst.startSet();
rst.initiate();
const primary = rst.getPrimary();
const secondary = rst.getSecondary();
jsTestLog("Shut down secondary.");
rst.stop(secondary);
jsTestLog("Safe reconfig twice to prove reconfigs are committed with secondary down.");
let config = rst.getReplSetConfigFromNode();
for (let i = 0; i < 2; i++) {
config.version++;
assert.commandWorked(primary.adminCommand({replSetReconfig: config}));
}
rst.restart(secondary);
rst.awaitReplication();
rst.stopSet();