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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.6.8
    • 2.2.4, 2.4.12, 2.6.5
    • Internal Client, Sharding
    • None
    • Fully Compatible
    • 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

        Activity

          People

            randolph@mongodb.com Randolph Tan
            randolph@mongodb.com Randolph Tan
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: