Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-446

Commands sent to mongos sometimes break when sending $readPreference

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.4.1
    • Affects Version/s: 2.4
    • Component/s: None
    • None

      Pre-2.3.1 versions of mongos do not support $readPreference for commands. In most cases this doesn't matter but some commands fail if $readPreference is included and the command document is not wrapped in $query.

      The workaround to provide maximum backward compatibility is to not send $readPreference to mongos if the mode is PRIMARY. Since PRIMARY is the default it's redundant anyway. We will also only send $readPreference for SECONDARY_PREFERRED if tags are being used. Setting the slaveOkay wire protocol flag has the exact same effect.

            Assignee:
            bernie@mongodb.com Bernie Hackett
            Reporter:
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: