-
Type:
Bug
-
Status: Closed
-
Priority:
Major - P3
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Backwards Compatibility:Fully Compatible
-
Operating System:ALL
-
Backport Requested:v4.2
-
Steps To Reproduce:
-
Sprint:Sharding 2019-12-02, Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13
-
Case:
On the mongos, we can run rs.slaveOk() to set the read preference to secondaryPreferred.
After running rs.slaveOk() on the mongos, the insert operation will still be routed to the primary so the insert will succeed.
However, ensureIndex will be routed to the secondary, so this command would fail.