summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2020-11-20 13:09:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-20 13:27:15 +0000
commit1cabc1efdd46b045bd85189e142fd9b3fa65dc1a (patch)
treee75ced079851e7726ca1175c08ff2d9cfef9d0c4
parentd0dfd00a48e83bc0e7e17d938f2578970a329304 (diff)
downloadmongo-1cabc1efdd46b045bd85189e142fd9b3fa65dc1a.tar.gz
SERVER-49291 Exclude reshardCollection from eMRC=off in tests.
-rw-r--r--jstests/sharding/libs/mongos_api_params_util.js12
-rw-r--r--jstests/sharding/reshard_collection_basic.js5
2 files changed, 15 insertions, 2 deletions
diff --git a/jstests/sharding/libs/mongos_api_params_util.js b/jstests/sharding/libs/mongos_api_params_util.js
index 88a7e9f18f7..ef0f3bab38c 100644
--- a/jstests/sharding/libs/mongos_api_params_util.js
+++ b/jstests/sharding/libs/mongos_api_params_util.js
@@ -45,7 +45,8 @@ let MongosAPIParametersUtil = (function() {
for (const [propertyName, defaultValue] of [["runsAgainstAdminDb", false],
["permittedInTxn", true],
["permittedOnShardedCollection", true],
- ["requiresShardedCollection", false]]) {
+ ["requiresShardedCollection", false],
+ ["requiresCommittedReads", false]]) {
if (testCase.hasOwnProperty(propertyName)) {
assert(typeof testCase[propertyName] === "boolean",
`${propertyName} must be a boolean: ${tojson(testCase)}`);
@@ -952,6 +953,8 @@ let MongosAPIParametersUtil = (function() {
permittedInTxn: false,
configServerCommandName: "_configsvrReshardCollection",
requiresShardedCollection: true,
+ // reshardCollection internally does atClusterTime reads.
+ requiresCommittedReads: true,
runsAgainstAdminDb: true,
command: () => ({reshardCollection: "db.collection", key: {_id: 1}})
}
@@ -1283,6 +1286,10 @@ let MongosAPIParametersUtil = (function() {
const listCommandsRes = st.s0.adminCommand({listCommands: 1});
assert.commandWorked(listCommandsRes);
+ const supportsCommittedReads =
+ assert.commandWorked(st.rs0.getPrimary().adminCommand({serverStatus: 1}))
+ .storageEngine.supportsCommittedReads;
+
(() => {
// Validate test cases for all commands. Ensure there is at least one test case for every
// mongos command, and that the test cases are well formed.
@@ -1394,6 +1401,9 @@ let MongosAPIParametersUtil = (function() {
if (!shardedCollection && runOrExplain.requiresShardedCollection)
continue;
+ if (!supportsCommittedReads && runOrExplain.requiresCommittedReads)
+ continue;
+
if (apiStrict && !runOrExplain.inAPIVersion1)
continue;
diff --git a/jstests/sharding/reshard_collection_basic.js b/jstests/sharding/reshard_collection_basic.js
index 734fb20fb4b..69fd2f1bb03 100644
--- a/jstests/sharding/reshard_collection_basic.js
+++ b/jstests/sharding/reshard_collection_basic.js
@@ -1,6 +1,9 @@
//
// Basic tests for reshardCollection.
-// @tags: [requires_fcv_47]
+// @tags: [
+// requires_fcv_47,
+// uses_atclustertime,
+// ]
//
load("jstests/libs/uuid_util.js");