diff options
author | Yunhe (John) Wang <yunhe.wang@mongodb.com> | 2015-09-10 11:19:32 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-09-10 17:33:17 -0400 |
commit | b3ca1d640e463be14134a2691c066fac18c54fe9 (patch) | |
tree | 7d8dff93eb1ba4fb52e2518653410117d54ff6ef | |
parent | c4f421ecb0b64a52f8b1e4dd6b617a83f7d24274 (diff) | |
download | mongo-b3ca1d640e463be14134a2691c066fac18c54fe9.tar.gz |
SERVER-20335 Mongos now forwards batchSize of none instead of 0
Closes #1018
Signed-off-by: David Storch <david.storch@10gen.com>
-rw-r--r-- | buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml | 2 | ||||
-rw-r--r-- | jstests/core/find_getmore_cmd.js | 2 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml index 4368608becd..a28a2471baa 100644 --- a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml @@ -46,8 +46,6 @@ selector: - jstests/core/dbcase2.js # SERVER-11735 # TODO: SERVER-17284 remove once find cmd is implemented in mongos - jstests/core/read_after_optime.js - - jstests/core/find_getmore_bsonsize.js - - jstests/core/find_getmore_cmd.js # TODO: SERVER-18292 remove once OP_COMMAND is implemented in mongos - jstests/core/invalid_db_name.js - jstests/core/validate_cmd_ns.js diff --git a/jstests/core/find_getmore_cmd.js b/jstests/core/find_getmore_cmd.js index 2801315b2c8..28b9d040a63 100644 --- a/jstests/core/find_getmore_cmd.js +++ b/jstests/core/find_getmore_cmd.js @@ -78,7 +78,7 @@ cmdRes = db.runCommand({ getMore: cmdRes.cursor.id, collection: collName, - batchSize: NumberInt(10) + batchSize: NumberInt(11) }); assert.eq(cmdRes.cursor.id, NumberLong(0)); assert.eq(cmdRes.cursor.ns, coll.getFullName()); diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index 799071553d6..289f8b29797 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -213,6 +213,13 @@ StatusWith<CursorId> runQueryWithoutRetrying(OperationContext* txn, params.isTailable = query.getParsed().isTailable(); params.isSecondaryOk = (readPref.pref != ReadPreference::PrimaryOnly); + // This is the batchSize passed to each subsequent getMore command issued by the cursor. We + // usually use the batchSize associated with the initial find, but as it is illegal to send a + // getMore with a batchSize of 0, we set it to use the default batchSize logic. + if (params.batchSize && *params.batchSize == 0) { + params.batchSize = boost::none; + } + // $natural sort is actually a hint to use a collection scan, and shouldn't be treated like a // sort on mongos. Including a $natural anywhere in the sort spec results in the whole sort // being considered a hint to use a collection scan. |