mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-38055 Mongod servers started through the shell must respect TestData.enableMajorityReadConcern
This commit is contained in:
parent
087f25379e
commit
a058fc68c5
35
jstests/noPassthrough/shell_disable_majority_reads.js
Normal file
35
jstests/noPassthrough/shell_disable_majority_reads.js
Normal file
@ -0,0 +1,35 @@
|
||||
// This test ensures that we respect the value of 'enableMajorityReadConcern' included in TestData.
|
||||
// @tags: [requires_wiredtiger, requires_replication, requires_majority_read_concern,
|
||||
// requires_persistence]
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
// Majority reads are enabled by default.
|
||||
let rst = new ReplSetTest({nodes: 1});
|
||||
rst.startSet();
|
||||
rst.initiate();
|
||||
|
||||
let serverStatus = rst.getPrimary().getDB("test").serverStatus();
|
||||
assert(serverStatus.storageEngine.supportsCommittedReads, tojson(serverStatus));
|
||||
rst.stopSet();
|
||||
|
||||
// Explicitly enable majority reads.
|
||||
TestData.enableMajorityReadConcern = true;
|
||||
rst = new ReplSetTest({nodes: 1});
|
||||
rst.startSet();
|
||||
rst.initiate();
|
||||
|
||||
serverStatus = rst.getPrimary().getDB("test").serverStatus();
|
||||
assert(serverStatus.storageEngine.supportsCommittedReads, tojson(serverStatus));
|
||||
rst.stopSet();
|
||||
|
||||
// Explicitly disable majority reads.
|
||||
TestData.enableMajorityReadConcern = false;
|
||||
rst = new ReplSetTest({nodes: 1});
|
||||
rst.startSet();
|
||||
rst.initiate();
|
||||
|
||||
serverStatus = rst.getPrimary().getDB("test").serverStatus();
|
||||
assert(!serverStatus.storageEngine.supportsCommittedReads, tojson(serverStatus));
|
||||
rst.stopSet();
|
||||
})();
|
@ -1146,7 +1146,7 @@ var MongoRunner, _startMongod, startMongoProgram, runMongoProgram, startMongoPro
|
||||
if (programName.endsWith('mongod')) {
|
||||
if (jsTest.options().storageEngine === "wiredTiger" ||
|
||||
!jsTest.options().storageEngine) {
|
||||
if (jsTest.options().enableMajorityReadConcern &&
|
||||
if (jsTest.options().enableMajorityReadConcern !== undefined &&
|
||||
!argArrayContains("--enableMajorityReadConcern")) {
|
||||
argArray.push(
|
||||
...['--enableMajorityReadConcern',
|
||||
|
Loading…
Reference in New Issue
Block a user