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

Read preference for an explain routed through mongos does not work on 3.0 for explain-of-count and explain-of-group

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 3.0.0
    • None
    • Querying, Sharding
    • None
    • ALL
    • Hide

      The attached test, explain_read_pref.js, demonstrates the issue. It is a slightly modified version of the test in the master branch (jstests/sharding/explain_read_pref.js).

      Show
      The attached test, explain_read_pref.js, demonstrates the issue. It is a slightly modified version of the test in the master branch (jstests/sharding/explain_read_pref.js).

    Description

      In 3.0, the host targeting logic on mongos only works for the explain command if explaining a find operation. If an explain of a count or group operation is routed through mongos with a read preference, the read preference is ignored. As a result, these explains are always delivered to the primary node, even for read preferences like "secondary" or "secondaryPreferred".

      This has already been fixed in the 3.1.8 development version under SERVER-19341. Therefore, the issue only affects the 3.0 branch. (It does not affect 2.6 or previous versions because find was the only explainable operation in these versions.)

      Attachments

        1. explain_read_pref.js
          5 kB
          David Storch

        Issue Links

          Activity

            People

              backlog-server-query Backlog - Query Team (Inactive)
              david.storch@mongodb.com David Storch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: