Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-1448

Remove client side limit tracking for cursors

    • Needed
    • Hide

      Summary of necessary driver changes

      •  

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  

      When iterating a cursor on MongoDB < 3.2, drivers use OP_GET_MORE and are required to keep track of the limit manually. The client uses OP_GET_MORE's nToReturn field to limit the number of documents are returned in the final batch such that the overall total # documents equals the original "limit".

      On MongoDB >=3.2, driver use the find and getMore commands and the server remembers what the original limit was. So when talking to MongoDB >=3.2, drivers do not need to manually track the limit and do not need to dynamically vary the getMore batchSize.

      This ticket proposes that drivers remove the client side cursor limit tracking when talking to MongoDB >=3.2. If we implement this proposal we would at least need to update the "A successful find event with a getmore and the server kills the cursor" command monitoring test. The test would need to be split by server version because in the legacy case the getMore batchSize changes from 3 to 1 whereas in >=3.2 the getMore batchSize remains 3.

      Motivation:

      • The legacy client side limit tracking adds unneeded complexity for newer servers.
      • Reducing the batchSize on the final getMore makes it more likely that drivers will need to run an unnecessary killCursors command (similar to DRIVERS-1447).

      Note: Combining Limit and Batch Size for the Wire Protocol in the CRUD spec can also be removed as part of this ticket.

            Assignee:
            nathan.xu@mongodb.com Nathan Xu
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Shane Harvey Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: