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

v3.0 mongos and v3.2 cluster explain command are not compatible

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 3.2.0-rc3
    • Fix Version/s: None
    • Component/s: Querying, Sharding
    • Labels:
      None
    • Operating System:
      ALL
    • Sprint:
      QuInt E (01/11/16)

      Description

      Some incompatibility observed include:

      1. Using v3.2 shell on v3.0 mongos can cause the mongos to ignore the read preference setting. This is because the read preference setting used to be inside the explain subdocument in v3.0 and is now moved to the top level in v3.2.

      2. Using v3.0 shell and v3.0 mongos with v3.2 shards to run an explain with slaveOk will result in:

      {
      	"ok" : 0,
      	"errmsg" : "Failed to parse options: { slaveOk: true }. You may need to update your shell or driver.",
      	"code" : 9
      }
      

        Issue Links

          Activity

          Hide
          spencer Spencer T Brody added a comment -

          Per offline discussion #2 above was previously considered and deemed to be acceptable behavior.

          #1, however, is a bug that we should fix for 3.2.1

          Show
          spencer Spencer T Brody added a comment - Per offline discussion #2 above was previously considered and deemed to be acceptable behavior. #1, however, is a bug that we should fix for 3.2.1
          Hide
          rassi J Rassi (Inactive) added a comment - - edited

          If we decide to fix #1, we may also want to fix related ticket SERVER-20236 (an outstanding issue with v3.0 mongos ignoring read preference for explain of operations other than find).

          Show
          rassi J Rassi (Inactive) added a comment - - edited If we decide to fix #1, we may also want to fix related ticket SERVER-20236 (an outstanding issue with v3.0 mongos ignoring read preference for explain of operations other than find).
          Hide
          renctan Randolph Tan added a comment -

          Based on my last discussion with David Storch, it sounded like #1 was an intentional design decision.

          Show
          renctan Randolph Tan added a comment - Based on my last discussion with David Storch , it sounded like #1 was an intentional design decision.
          Hide
          david.storch David Storch added a comment -

          Randolph Tan Spencer T Brody, we did intentionally change how the shell passes read preference to mongos for explain. In 3.0, there is a special format for attaching read preference to explain; specifically, the read preference goes inside the find command itself:

          {explain: {find: "collection", $readPreference: {...}}}
          

          In 3.2, read preference for explain is just like read preference for any other command. We use the "wrapped" command form:

          {$query: {explain: {find: "collection"}}, $readPreference: {...}}
          

          This change was intentional in order to make read preference handling consistent for all commands. However, we still may want to fix problem #1. The likely approach for the fix would be to write compatibility code in the shell. If a 3.2 shell detects that it sending an explain command to a 3.0 mongos, it should use the deprecated read preference format that a 3.0 mongos can understand.

          Show
          david.storch David Storch added a comment - Randolph Tan Spencer T Brody , we did intentionally change how the shell passes read preference to mongos for explain. In 3.0, there is a special format for attaching read preference to explain; specifically, the read preference goes inside the find command itself: {explain: {find: "collection", $readPreference: {...}}} In 3.2, read preference for explain is just like read preference for any other command. We use the "wrapped" command form: {$query: {explain: {find: "collection"}}, $readPreference: {...}} This change was intentional in order to make read preference handling consistent for all commands. However, we still may want to fix problem #1. The likely approach for the fix would be to write compatibility code in the shell. If a 3.2 shell detects that it sending an explain command to a 3.0 mongos, it should use the deprecated read preference format that a 3.0 mongos can understand.
          Hide
          david.storch David Storch added a comment -

          After further discussion, we have decided to close this issue as "Won't Fix". The format changes made to $readPreference and the find command during the 3.2 cycle were made knowing that this could cause some compatibility problems in mixed version scenarios. Our assessment was that these compatibility problems would not arise in common use cases. If we find that mixed version explain using readPreference or slaveOk is an important configuration to support, we can re-open this ticket and provide a fix.

          Show
          david.storch David Storch added a comment - After further discussion, we have decided to close this issue as "Won't Fix". The format changes made to $readPreference and the find command during the 3.2 cycle were made knowing that this could cause some compatibility problems in mixed version scenarios. Our assessment was that these compatibility problems would not arise in common use cases. If we find that mixed version explain using readPreference or slaveOk is an important configuration to support, we can re-open this ticket and provide a fix.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                  Agile