diff options
author | Cheahuychou Mao <cheahuychou.mao@mongodb.com> | 2019-12-20 19:48:44 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-20 19:48:44 +0000 |
commit | b3a0c28b7c3278a151f2f3b233303850ee9a4801 (patch) | |
tree | d39cd907b0c7a5f6e12a8d23125ddc39254c46bb | |
parent | 002ab710e465641cc9bade02fe00d15301707757 (diff) | |
download | mongo-b3a0c28b7c3278a151f2f3b233303850ee9a4801.tar.gz |
SERVER-45272 Remove assertions about the last-stable behavior in allow_partial_results.js and return_partial_shards_down.js
(cherry picked from commit aae7c4aa9aeb1df1a3a1b00ae12aed7e1a77b59c)
-rw-r--r-- | jstests/sharding/allow_partial_results.js | 12 | ||||
-rw-r--r-- | jstests/sharding/return_partial_shards_down.js | 12 |
2 files changed, 4 insertions, 20 deletions
diff --git a/jstests/sharding/allow_partial_results.js b/jstests/sharding/allow_partial_results.js index 0f10093bbb0..dd90c7ed50e 100644 --- a/jstests/sharding/allow_partial_results.js +++ b/jstests/sharding/allow_partial_results.js @@ -56,16 +56,8 @@ assert.commandFailed(coll.runCommand({find: collName})); 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.2, 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 v4.0, the command should - // fail. - jsTest.log( - "With 'allowPartialResults: true', if some shard down and mongos version is v4.0, find fails"); - assert.commandFailedWithCode(coll.runCommand({find: collName, allowPartialResults: true}), - ErrorCodes.FailedToSatisfyReadPreference); -} else { +// TODO (SERVER-45273): Remove this mongos bin version check. +if (jsTestOptions().mongosBinVersion != "last-stable") { jsTest.log( "With 'allowPartialResults: true', if some shard down, find succeeds with partial results"); findRes = coll.runCommand({find: collName, allowPartialResults: true}); diff --git a/jstests/sharding/return_partial_shards_down.js b/jstests/sharding/return_partial_shards_down.js index 76a73e9c52b..2015b35121a 100644 --- a/jstests/sharding/return_partial_shards_down.js +++ b/jstests/sharding/return_partial_shards_down.js @@ -6,16 +6,8 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; var checkDocCount = function(coll, returnPartialFlag, shardsDown, expectedCount) { - if (jsTestOptions().mongosBinVersion == "last-stable" && shardsDown) { - // In v4.2, 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 v4.0, the command should - // fail. - var error = assert.throws(function() { - coll.find({}, {}, 0, 0, 0, returnPartialFlag).itcount(); - }); - assert(ErrorCodes.FailedToSatisfyReadPreference == error.code); - } else { + // TODO (SERVER-45273): Remove this mongos bin version check. + if (jsTestOptions().mongosBinVersion != "last-stable") { assert.eq(expectedCount, coll.find({}, {}, 0, 0, 0, returnPartialFlag).itcount()); } }; |