summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jstests/sharding/allow_partial_results.js21
-rw-r--r--jstests/sharding/return_partial_shards_down.js13
2 files changed, 6 insertions, 28 deletions
diff --git a/jstests/sharding/allow_partial_results.js b/jstests/sharding/allow_partial_results.js
index 81c2985218c..37b6c5d1ddd 100644
--- a/jstests/sharding/allow_partial_results.js
+++ b/jstests/sharding/allow_partial_results.js
@@ -57,22 +57,11 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true;
jsTest.log("With 'allowPartialResults: false', if some shard down, find fails.");
assert.commandFailed(coll.runCommand({find: collName, allowPartialResults: false}));
- if (jsTestOptions().mongosBinVersion == "last-stable") {
- // In v4.0, mongos was updated to swallow FailedToSatisfyReadPreference errors if
- // allowPartialResults is true, allowing allowPartialResults to work with replica set shards
- // (see SERVER-33597 for details). So when the mongos version is v3.6, the command should
- // fail.
- jsTest.log(
- "With 'allowPartialResults: true', if some shard down and mongos version is v3.6, find fails");
- assert.commandFailedWithCode(coll.runCommand({find: collName, allowPartialResults: true}),
- ErrorCodes.FailedToSatisfyReadPreference);
- } else {
- jsTest.log(
- "With 'allowPartialResults: true', if some shard down, find succeeds with partial results");
- findRes = coll.runCommand({find: collName, allowPartialResults: true});
- assert.commandWorked(findRes);
- assert.eq(nDocs / 2, findRes.cursor.firstBatch.length);
- }
+ jsTest.log(
+ "With 'allowPartialResults: true', if some shard down, find succeeds with partial results");
+ findRes = coll.runCommand({find: collName, allowPartialResults: true});
+ assert.commandWorked(findRes);
+ assert.eq(nDocs / 2, findRes.cursor.firstBatch.length);
jsTest.log("The allowPartialResults option does not currently apply to aggregation.");
assert.commandFailedWithCode(coll.runCommand({
diff --git a/jstests/sharding/return_partial_shards_down.js b/jstests/sharding/return_partial_shards_down.js
index debbb174c4c..ab5d2774dfb 100644
--- a/jstests/sharding/return_partial_shards_down.js
+++ b/jstests/sharding/return_partial_shards_down.js
@@ -6,18 +6,7 @@
TestData.skipCheckingUUIDsConsistentAcrossCluster = true;
var checkDocCount = function(coll, returnPartialFlag, shardsDown, expectedCount) {
- if (jsTestOptions().mongosBinVersion == "last-stable" && shardsDown) {
- // In v4.0, mongos was updated to swallow FailedToSatisfyReadPreference errors if
- // allowPartialResults is true, allowing allowPartialResults to work with replica set shards
- // (see SERVER-33597 for details). So when the mongos version is v3.6, the command should
- // fail.
- var error = assert.throws(function() {
- coll.find({}, {}, 0, 0, 0, returnPartialFlag).itcount();
- });
- assert(ErrorCodes.FailedToSatisfyReadPreference == error.code);
- } else {
- assert.eq(expectedCount, coll.find({}, {}, 0, 0, 0, returnPartialFlag).itcount());
- }
+ assert.eq(expectedCount, coll.find({}, {}, 0, 0, 0, returnPartialFlag).itcount());
};
var st = new ShardingTest({shards: 3, mongos: 1, other: {mongosOptions: {verbose: 2}}});