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

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.8
    • Component/s: Querying, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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
    • Sprint:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: