-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 5.1.5
-
Component/s: None
-
Environment:jruby 9.1.6.0, mongoid 5.1.5, mongo 2.3.0, bson 4.1.1-java
Configure the `default` client to use read mode `:secondary_preferred`. Then configure a `primary` client to use read mode `:primary`. Then:
```
Mongo::Logger.level = Logger::DEBUG
MyModel.where(key: 'existing_key').with(client: :primary).first
- logs show that model is fetched from primary, as expected
q = MyModel.where(key: 'existing_key')
q.first
- logs show that model is fetched from secondary, as expected
q.with(client: :primary).first
- logs show that model is fetched from secondary, which is unexpected
```