summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheahuychou Mao <cheahuychou.mao@mongodb.com>2020-02-14 11:37:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-02-18 16:08:03 +0000
commitd9a68d2c084bfed60527aa9aa29e2a843b97e9c2 (patch)
treeb474f02290a39453f949b5d846c258d9ef9abf55
parent77911ece0c066a68eb22f35d63b9ffd6c109b442 (diff)
downloadmongo-d9a68d2c084bfed60527aa9aa29e2a843b97e9c2.tar.gz
SERVER-45273 Remove the mongos version check in allow_partial_results.js and return_partial_shards_down.js
-rw-r--r--jstests/sharding/allow_partial_results.js53
-rw-r--r--jstests/sharding/return_partial_shards_down.js5
2 files changed, 26 insertions, 32 deletions
diff --git a/jstests/sharding/allow_partial_results.js b/jstests/sharding/allow_partial_results.js
index ebd23d49022..8ba369a74c2 100644
--- a/jstests/sharding/allow_partial_results.js
+++ b/jstests/sharding/allow_partial_results.js
@@ -88,34 +88,31 @@ assert.commandFailed(coll.runCommand({find: collName}));
jsTest.log("With 'allowPartialResults: false', if some shards are down, find fails.");
assert.commandFailed(coll.runCommand({find: collName, allowPartialResults: false}));
-// TODO (SERVER-45273): Remove this mongos bin version check.
-if (!isLastStable) {
- nRemainingDocs = nDocs / 2;
-
- jsTest.log(
- "With 'allowPartialResults: true', if some shards are down, find returns partial results");
- findRes = coll.runCommand({find: collName, allowPartialResults: true, batchSize: batchSize});
- assert.commandWorked(findRes);
- assert.eq(batchSize, findRes.cursor.firstBatch.length);
- assert.eq(true, findRes.cursor.partialResultsReturned);
- nRemainingDocs -= batchSize;
-
- jsTest.log(
- "getMore after a find that returns partial results returns partialResultsReturned: 1");
- getMoreRes =
- coll.runCommand({getMore: findRes.cursor.id, collection: collName, batchSize: batchSize});
- assert.commandWorked(getMoreRes);
- assert.eq(batchSize, getMoreRes.cursor.nextBatch.length);
- assert.eq(true, getMoreRes.cursor.partialResultsReturned);
- nRemainingDocs -= batchSize;
-
- jsTest.log(
- "Subsequent getMores should return partialResultsReturned: 1 regardless of the batch size.");
- getMoreRes = coll.runCommand({getMore: findRes.cursor.id, collection: collName});
- assert.commandWorked(getMoreRes);
- assert.eq(nRemainingDocs, getMoreRes.cursor.nextBatch.length);
- assert.eq(true, getMoreRes.cursor.partialResultsReturned);
-}
+nRemainingDocs = nDocs / 2;
+
+jsTest.log(
+ "With 'allowPartialResults: true', if some shards are down, find returns partial results");
+findRes = coll.runCommand({find: collName, allowPartialResults: true, batchSize: batchSize});
+assert.commandWorked(findRes);
+assert.eq(batchSize, findRes.cursor.firstBatch.length);
+assert.eq(isLastStable ? undefined : true, findRes.cursor.partialResultsReturned);
+nRemainingDocs -= batchSize;
+
+jsTest.log(
+ "getMore after a find that returns partial results returns partialResultsReturned: true");
+getMoreRes =
+ coll.runCommand({getMore: findRes.cursor.id, collection: collName, batchSize: batchSize});
+assert.commandWorked(getMoreRes);
+assert.eq(batchSize, getMoreRes.cursor.nextBatch.length);
+assert.eq(isLastStable ? undefined : true, getMoreRes.cursor.partialResultsReturned);
+nRemainingDocs -= batchSize;
+
+jsTest.log(
+ "Subsequent getMores should return partialResultsReturned: true regardless of the batch size.");
+getMoreRes = coll.runCommand({getMore: findRes.cursor.id, collection: collName});
+assert.commandWorked(getMoreRes);
+assert.eq(nRemainingDocs, getMoreRes.cursor.nextBatch.length);
+assert.eq(isLastStable ? undefined : true, getMoreRes.cursor.partialResultsReturned);
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 0e12920bc5e..8c6781aeb1f 100644
--- a/jstests/sharding/return_partial_shards_down.js
+++ b/jstests/sharding/return_partial_shards_down.js
@@ -7,10 +7,7 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true;
TestData.skipCheckingIndexesConsistentAcrossCluster = true;
var checkDocCount = function(coll, returnPartialFlag, shardsDown, expectedCount) {
- // TODO (SERVER-45273): Remove this mongos bin version check.
- if (jsTestOptions().mongosBinVersion != "last-stable") {
- 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}}});