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

mongos shouldn't accept initial query with "exhaust" flag set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.4, 2.7.4
    • Component/s: Sharding
    • Labels:
      None
    • Operating System:
      ALL
    • Backport Completed:

      Description

      Issue Status as of Aug 6, 2014

      ISSUE SUMMARY
      A connection to a mongos with the "exhaust" flag set is ignored, and mongos returns a regular cursor instead.

      USER IMPACT
      The connection deadlocks after the first batch if the driver iterates over the cursor: mongos is waiting for a getMore operation, while the driver is waiting for an OP_REPLY.

      WORKAROUNDS
      Remove the exhaust flag from queries through mongos.

      AFFECTED VERSIONS
      MongoDB 2.6 production releases up to 2.6.3 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.4 production release.

      RESOLUTION DETAILS
      Disallow exhaust query option through mongos.

      Original description

      Mongos doesn't implement exhaust cursors. If a client creates a cursor by sending OP_QUERY to mongos with the "exhaust" flag set, mongos ignores it and returns a regular cursor. When the driver iterates the cursor, it deadlocks after the first batch: mongos is waiting for a getMore, and the driver is waiting for an OP_REPLY.

      Those official drivers that implement exhaust cursors are written to prevent this case. But it'd be even better if mongos checked the exhaust flag and failed immediately. (Until such time as mongos implements exhaust cursors.)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: