0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-56642 fix read_write_concern_defaults_propagation.js when change default write concern feature flag enabled

This commit is contained in:
Samy Lanka 2021-05-19 01:37:11 +00:00 committed by Evergreen Agent
parent 2cc51d1d39
commit 5005b41c78
3 changed files with 6 additions and 17 deletions

View File

@ -1,6 +1,8 @@
var ReadWriteConcernDefaultsPropagation = (function() {
"use strict";
load("jstests/libs/write_concern_util.js"); // For isDefaultWriteConcernMajorityFlagEnabled.
const kDefaultReadConcernField = "defaultReadConcern";
const kDefaultWriteConcernField = "defaultWriteConcern";
const kUpdateOpTimeField = "updateOpTime";
@ -136,7 +138,10 @@ var ReadWriteConcernDefaultsPropagation = (function() {
// Note localUpdateWallClockTime is generated by the in-memory cache, so it will be
// present even if there are no defaults
const unexpectedFields = kDefaultRWCFields.concat(kExtraSetFields);
const unexpectedFields = kDefaultRWCFields.concat(kExtraSetFields).filter(field => {
return !isDefaultWriteConcernMajorityFlagEnabled(checkConn) ||
field !== kDefaultWriteConcernField;
});
return unexpectedFields.every(field => !defaultsRes.hasOwnProperty(field));
}),
"deleted/dropped defaults failed to propagate to all nodes within " +

View File

@ -3,7 +3,6 @@
'use strict';
load("jstests/libs/read_write_concern_defaults_propagation_common.js");
load("jstests/libs/write_concern_util.js"); // For isDefaultWriteConcernMajorityFlagEnabled.
const rst = new ReplSetTest({nodes: 3});
rst.startSet();
@ -12,13 +11,6 @@ rst.initiate();
const primary = rst.getPrimary();
const secondaries = rst.getSecondaries();
// TODO (SERVER-56642): Fix the test to work with the new default write concern.
if (isDefaultWriteConcernMajorityFlagEnabled(primary)) {
jsTestLog("Skipping test because the default WC majority feature flag is enabled.");
rst.stopSet();
return;
}
ReadWriteConcernDefaultsPropagation.runTests(primary, [primary, ...secondaries]);
// Verify the in-memory defaults are updated correctly. This verifies the cache is invalidated

View File

@ -3,7 +3,6 @@
'use strict';
load("jstests/libs/read_write_concern_defaults_propagation_common.js");
load("jstests/libs/write_concern_util.js"); // For isDefaultWriteConcernMajorityFlagEnabled.
var st = new ShardingTest({
shards: 1,
@ -14,13 +13,6 @@ var st = new ShardingTest({
}
});
// TODO (SERVER-56642): Fix the test to work with the new default write concern.
if (isDefaultWriteConcernMajorityFlagEnabled(st.s)) {
jsTestLog("Skipping test because the default WC majority feature flag is enabled.");
st.stop();
return;
}
const mongosAndConfigNodes = [st.s0, st.s1, st.s2, ...st.configRS.nodes];
ReadWriteConcernDefaultsPropagation.runTests(st.s0, mongosAndConfigNodes);