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

mongoS doesn't set batch size (and keeps the old one, 0) on getMore if performed on first _cursor->more()

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.11, 3.0.5, 3.1.6
    • Affects Version/s: 2.6.10, 3.0.3, 3.1.4
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 6 07/17/15

      mongos in cursors.cpp only sets batch size (and always sets batch size) after a document is returned. This leads to the batch size being set to 0 every time a full load of ntoreturn documents are sent back to the client. If the cursor is exhausted at that point, then the next getMore request to the mongoD (which will be sent on the next will request to the mongoS) will have a batch size of 0. This returns all results and can lead to cursors timing out.

      Moving the setBatchSize before the loop starts and after all breaks (so no useless work is performed setting an invalid batch size on break) should fix this.

            Assignee:
            charlie.page@10gen.com Charlie Page
            Reporter:
            charlie.page@10gen.com Charlie Page
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: