Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-786

Make the router return flag in response to indicate if partial results were returned

    • Type: Icon: Epic Epic
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: CRUD
    • Labels:
      None
    • Hide

      The "allowPartialResults" option of the "find" command permits a query to run on a sharded cluster even in cases where some of the shards are not available. In this case, the results will consist of the subset of data present on the available shards. However, until now there was no way for a client to know whether the data they received was complete or partial.

      This change adds a new field, "partialResultsReturned", in the "cursor" object returned to the client by the "find" and "getMore" commands. In the event that some of the shards are not available at the time the query is run, or if some shards disconnect while the cursor is being iterated, this field will be present and will have a boolean value of true. If all shards are available, the field will be absent.

      This flag is scoped to the cursor, not to an individual operation; all getMores after the point where a shard disconnects will be flagged as "partialResultsReturned".

      Show
      The "allowPartialResults" option of the "find" command permits a query to run on a sharded cluster even in cases where some of the shards are not available. In this case, the results will consist of the subset of data present on the available shards. However, until now there was no way for a client to know whether the data they received was complete or partial. This change adds a new field, "partialResultsReturned", in the "cursor" object returned to the client by the "find" and "getMore" commands. In the event that some of the shards are not available at the time the query is run, or if some shards disconnect while the cursor is being iterated, this field will be present and will have a boolean value of true. If all shards are available, the field will be absent. This flag is scoped to the cursor, not to an individual operation; all getMores after the point where a shard disconnects will be flagged as "partialResultsReturned".

      Downstream Change Summary

      The "allowPartialResults" option of the "find" command permits a query to run on a sharded cluster even in cases where some of the shards are not available. In this case, the results will consist of the subset of data present on the available shards. However, until now there was no way for a client to know whether the data they received was complete or partial.

      This change adds a new field, "partialResultsReturned", in the "cursor" object returned to the client by the "find" and "getMore" commands. In the event that some of the shards are not available at the time the query is run, or if some shards disconnect while the cursor is being iterated, this field will be present and will have a boolean value of true. If all shards are available, the field will be absent.

      This flag is scoped to the cursor, not to an individual operation; all getMores after the point where a shard disconnects will be flagged as "partialResultsReturned".

      Description of Linked Ticket

      Right now, a user can opt in to getting partial results (that is, ignoring unreachable shards) by passing allowPartialResults: true  in their find command.

      However, they have no way to tell if partial results were actually returned.

      This ticket is to make mongos return a flag in its response if partial results were returned.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: