-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.2.4, 2.4.12, 2.6.5
-
Component/s: Internal Client, Sharding
-
None
-
Fully Compatible
-
ALL
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.
- duplicates
-
SERVER-9788 mongos does not re-evaluate read preference once a valid replica set member is chosen
- Closed
- is duplicated by
-
SERVER-10901 Using read preference causes stale version info
- Closed
- is related to
-
SERVER-17441 mongos crash right after "not master" error
- Closed
-
SERVER-7612 explicit primary read pref does not work well with shard versioning
- Closed