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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.4, 2.7.4
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • ALL

      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.)

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: