diff options
| author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2020-02-14 11:37:46 -0500 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-18 17:33:44 +0000 |
| commit | 64bfcac36bb99242864f55de620720b4d9376cd2 (patch) | |
| tree | 1b8e23b889f9eb5c1608b26a26390f551802ca3e | |
| parent | 94940ab14441d88d95a22b537d6d84d78fc0910d (diff) | |
| download | mongo-64bfcac36bb99242864f55de620720b4d9376cd2.tar.gz | |
SERVER-45273 Remove the mongos version check in allow_partial_results.js and return_partial_shards_down.js
(cherry picked from commit d9a68d2c084bfed60527aa9aa29e2a843b97e9c2)
| -rw-r--r-- | jstests/sharding/allow_partial_results.js | 21 | ||||
| -rw-r--r-- | jstests/sharding/return_partial_shards_down.js | 13 |
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}}}); |
