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

Implement support for exhaust cursors with OP_MSG in DBClientCursor

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.3
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Repl 2018-08-13, Repl 2018-08-27, Repl 2018-09-10
    • Linked BF Score:
      0

      Description

      DBClientCursor will implement the client side of the exhaust cursor OP_MSG protocol when commands are being used and QueryOption_Exhaust is requested.

      • When more() is called after the initial find command, it will set the wire protocol bit exhaustAllowed on the getMore command it sends.  DBClientCursor will not set this bit on initial find commands.  Note that older implementations which do not support OP_MSG exhaust will ignore this bit, as required by the wire protocol spec.
      • When more() is called after there was a response to the getMore command that had the wire protocol moreToCome bit set, it will receive the next batch and make it available to the caller.
      • If the response does not have the moreToCome bit set and it indicates an error or the cursor is exhausted (cursor id of 0), more() will return false.
      • If the response does not have the moreToCome bit set, and also does not indicate the cursor is exhausted or contain an error, DBClientCursor will send another getMore command.  This handles the upgrade case when connecting to a 4.0 implementation which does not support OP_MSG exhaust.

      As part of this work, we will remove OP_QUERY exhaust support from DBClientConnection.  This is currently used only by the database cloner, so the only effect of this will be to cause a performance regression when cloning between 4.0 and 4.2, and the commands which use the database cloner are deprecated.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: