Eliminate unnecessary killCursors command when batchSize == limit

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.19.0
    • Affects Version/s: None
    • Component/s: CRUD
    • 3
    • 1
    • Hide

      DRIVERS-1447:
      To work around a server issue, 2362d1a adds guidance on how to set limit and batchSize. TL;DR: if limit is set to the same value as batchSize, a higher batchSize MUST be sent to avoid an open cursor on the server. Note that despite this, the server may yield a cursor if not all results fit in the command response due to size limitations.

      It is suggested to combine this work with DRIVERS-3009.

      Show
      DRIVERS-1447: To work around a server issue, 2362d1a adds guidance on how to set limit and batchSize . TL;DR: if limit is set to the same value as batchSize , a higher batchSize MUST be sent to avoid an open cursor on the server. Note that despite this, the server may yield a cursor if not all results fit in the command response due to size limitations. It is suggested to combine this work with DRIVERS-3009 .
    • Not Needed
    • None
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      This ticket was split from DRIVERS-1447, please see that ticket for a detailed description.

      Use Case

      As a developer
      I want optimal resource usage and performance when using findOne
      So that I have performant queries and do not leave open cursors on the server.

      User Experience

      • findOne will no longer leave cursors open on the server or send an unnecessary killCursors command.

      Dependencies

      • None

      Risks/Unknowns

      • None

      Acceptance Criteria

      Implementation Requirements

      • Deprecate batchSize, cursorType, limit, and noCursorTimeout options from the options that can be provided to findOne.
      • Automatically set limit: 1 and singleBatch: true for all findOne find commands.
      • Ensure no killCursors command is sent to the server.
      • For find, if a limit and batchSize are provided with the same value, the driver must override the batchSize to limit + 1

      Testing Requirements

      Documentation Requirements

      Follow Up Requirements

            Assignee:
            Durran Jordan
            Reporter:
            TPM Jira Automations Bot
            Bailey Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: