mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-24 16:46:00 +01:00
771dabd098
GitOrigin-RevId: 744aa110a53786b23c62ff53f87a1418b5991e8d
21 lines
608 B
JavaScript
21 lines
608 B
JavaScript
/**
|
|
* Test that protocolVersion defaults to 1 even during a replSetReconfig.
|
|
*/
|
|
import {ReplSetTest} from "jstests/libs/replsettest.js";
|
|
|
|
var rst = new ReplSetTest({nodes: 2});
|
|
rst.startSet();
|
|
rst.initiate();
|
|
|
|
const primary = rst.getPrimary();
|
|
var config = primary.getDB("local").system.replset.findOne();
|
|
config.version++;
|
|
delete config.protocolVersion;
|
|
|
|
assert.commandWorked(primary.adminCommand({replSetReconfig: config}));
|
|
|
|
// Make sure that the config still has the proper protocolVersion.
|
|
config = primary.getDB("local").system.replset.findOne();
|
|
assert.eq(config.protocolVersion, 1);
|
|
|
|
rst.stopSet(); |