Eliminate unnecessary killCursors command when batchSize == limit

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • 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 .
    • 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
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • 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
      • Refactor findOne to no longer instantiate a FindCursor and to use a command operation instead.

      Testing Requirements

      Documentation Requirements

      • API docs should indicate deprecated options.
      • The deprecated options are not mentioned in the CRUD/findOne section of the MongoDB Nodejs manual. The API doc update will suffice.
      • Note any performance improvements in the release highlight.

      Follow Up Requirements

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

              Created:
              Updated: