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

Better Error Response from Shard with No Primary

    XMLWordPrintableJSON

Details

    • Sharding

    Description

      This comes out of the discussion on JAVA-1118.

      Improve (ie: more descriptive and unique) error type/code/message response when a shard is unable to serve a query due to a read preference mismatch.

      For instance, in the Java driver 2.12.0, in the case of a mismatch (such as primary requested but only secondaries are available), the driver will throw an exception with type MongoServerSelectionException rather than a generic exception. However, in a sharded environment, according to my testing and what Jeff has mentioned in JAVA-1118 the mongo server (or mongos) doesn't return enough information and the driver is forced to throw a generic exception in this case.

      It would be great if the specifics of this error could be passed in the response to the driver so a specific exception can be thrown at this level.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-sharding Backlog - Sharding Team
              djones@squarespace.com Doug Jones
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: