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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.8
    • Affects Version/s: None
    • Component/s: 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

      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

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

              Created:
              Updated:
              Resolved: