diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2017-01-07 15:08:22 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2017-01-07 15:08:22 -0500 |
commit | cdc7af4c6d453b8c1ce2319d0cd3b50074609d87 (patch) | |
tree | 681a5704ee7bdd32052dfe43ab1be03680b7a478 /jstests/auth/resource_pattern_matching.js | |
parent | ef364240d7d48a8a352afb91df5cddbd34394021 (diff) | |
download | mongo-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/auth/resource_pattern_matching.js')
-rw-r--r-- | jstests/auth/resource_pattern_matching.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jstests/auth/resource_pattern_matching.js b/jstests/auth/resource_pattern_matching.js index 36d6711ea52..0d9781efd4b 100644 --- a/jstests/auth/resource_pattern_matching.js +++ b/jstests/auth/resource_pattern_matching.js @@ -231,7 +231,8 @@ print('--- replica set test ---'); var rst = new ReplSetTest({ name: 'testset', nodes: 2, - nodeOptions: {'auth': null, 'httpinterface': null, 'keyFile': keyfile} + nodeOptions: {'auth': null, 'httpinterface': null}, + keyFile: keyfile }); rst.startSet(); |