summaryrefslogtreecommitdiff
path: root/jstests/sslSpecial
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2017-01-07 15:08:22 -0500
committerAndy Schwerin <schwerin@mongodb.com>2017-01-07 15:08:22 -0500
commitcdc7af4c6d453b8c1ce2319d0cd3b50074609d87 (patch)
tree681a5704ee7bdd32052dfe43ab1be03680b7a478 /jstests/sslSpecial
parentef364240d7d48a8a352afb91df5cddbd34394021 (diff)
downloadmongo-cdc7af4c6d453b8c1ce2319d0cd3b50074609d87.tar.gz
SERVER-27490 Stop consulting storage engine isDurable flag in ReplicationCoordinatorImpl
... and simplify ReplCoordTestFixture ReplicationCoordinatorImpl consults the storage engine's isDurable flag for two purposes: 1. To choose whether to present the durable or applied optime when standing for election in pv1 2. To decide how to interpret w:majority without an explicit j field when waiting for write concern. In the first case, it is unnecessary to choose which optime to apply based on the isDurable flag. It is always safe and correct to present the applied optime, because if the node presenting it wins election, it will attempt to commit that applied optime. That means that voters may safely vote for that node. In the second case, using the value of the local node's storage engine's isDurable flag to adjust the meaning of w:majority is out of spec. Whether w:majority writes wait for journaling is a function only of the writeConcernMajorityJournalDefault flag when a write concern omits the "j" field. This patch removes the unnecessary consultation of the isDurable flag, and uses the opportunity to simplify the constructor of ReplicationCoordinatorImpl and its test fixture.
Diffstat (limited to 'jstests/sslSpecial')
-rw-r--r--jstests/sslSpecial/upgrade_to_x509_ssl_nossl.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/jstests/sslSpecial/upgrade_to_x509_ssl_nossl.js b/jstests/sslSpecial/upgrade_to_x509_ssl_nossl.js
index 47cc303069c..990f4983a91 100644
--- a/jstests/sslSpecial/upgrade_to_x509_ssl_nossl.js
+++ b/jstests/sslSpecial/upgrade_to_x509_ssl_nossl.js
@@ -19,6 +19,18 @@ function authAllNodes() {
}
}
+// The mongo shell cannot authenticate as the internal __system user in tests that use x509 for
+// cluster authentication. Choosing the default value for wcMajorityJournalDefault in
+// ReplSetTest cannot be done automatically without the shell performing such authentication, so
+// in this test we must make the choice explicitly, based on the global test options.
+var wcMajorityJournalDefault;
+if (jsTestOptions().noJournal || jsTestOptions().storageEngine == "ephemeralForTest" ||
+ jsTestOptions().storageEngine == "inMemory") {
+ wcMajorityJournalDefault = false;
+} else {
+ wcMajorityJournalDefault = true;
+}
+
opts = {
sslMode: "disabled",
clusterAuthMode: "keyFile",
@@ -27,7 +39,8 @@ opts = {
var NUM_NODES = 3;
var rst = new ReplSetTest({name: 'sslSet', nodes: NUM_NODES, nodeOptions: opts});
rst.startSet();
-rst.initiate();
+rst.initiate(Object.extend(rst.getReplSetConfig(),
+ {writeConcernMajorityJournalDefault: wcMajorityJournalDefault}));
// Connect to master and do some basic operations
var rstConn1 = rst.getPrimary();