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

Possible for _master and _slaveConn to be pointing to different connections even with primary read pref

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.4.12, 2.6.5
    • Fix Version/s: 2.6.8
    • Component/s: Internal Client, Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL

      Description

      There is a potential bug in DBClientReplicaSet that would cause _lastSlaveOkConn and _master to be different even if readPref was set to primary. This is plausible in theory since _lastSlaveOkConn and _master are simply shared pointers, so _master and _lastSlaveConn in theory can point to different instances. Currently, I can't find a way to make this happen, but it is plausible since whenever we clear the pointer on the _master, we don't do it on _lastSlaveConn and vice versa.

      One observed behavior from a user is that connection used to send setShardVersion is different from the actual connection that sends the query, and thus goes into this loop where the shard rejects because the version is wrong and mongos retries with the right setShardVersion (but on the wrong connection) until it reaches the maximum retries.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: