Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-3887

Driver sets getMore command batchSize to min(batchSize, remainingLimit)

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Query Operations

      The driver sets batchSize for getMore commands to the minimum of the configured batch size and the number of documents that would cause the configured limit to be reached. There is no reason to do this, and it actually causes the driver to sometimes send an unnecessary killCursors command, as in some scenarios mongos servers do not close the cursor if the limit was only just reached. It's also an inconsistency with other drivers that can cause issues with specification test expectations.

      We should fix this by just sending the batchSize configured by the application.

      At the same time, we can also remove all the client-side checks for the limit being reached, as the server now takes responsibility for that (ever since the introduction of the find command).

            Assignee:
            Unassigned Unassigned
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: