Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20335

Mongos should not forward a getMore command to the shards with a batchSize of 0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.1.8
    • Querying, Sharding
    • None
    • Fully Compatible
    • ALL
    • Hide

      python buildscripts/resmoke.py --executor=sharding_jscore_passthrough jstests/core/find_getmore_bsonsize.js

      Show
      python buildscripts/resmoke.py --executor=sharding_jscore_passthrough jstests/core/find_getmore_bsonsize.js
    • Quint 9 09/18/15

    Description

      If the batchSize associated with the initial find command is zero, then the AsyncResultsMerger will send a batchSize of zero to the shards for subsequent getMore commands. Setting a batchSize of zero is illegal for the getMore command and the mongod will return a BadValue error: "Batch size for getMore must be positive, but received: 0".

      Instead, the getMore commands forwarded to the shards should not have a batchSize. In order to fix, we should not set the value of ClusterClientCursorParams::batchSize to boost::none rather than zero here:

      https://github.com/mongodb/mongo/blob/4a6ff97bd91c340eea7142d13153a495ab3964a3/src/mongo/s/query/cluster_find.cpp#L149

      Attachments

        Issue Links

          Activity

            People

              yunhe.wang YunHe Wang
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: