-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.2
-
Fully Compatible
-
ALL
-
-
Query 2017-03-27, Query 2017-04-17
When mongos rewrites a query over a view as a query over the view's backing collection, it discards the readPreference. The result is that reads over views will always target the primary node of all involved shards, even if the application specified a read preference such as "secondary" or "secondaryPreferred".
Note that mongos will always forward a query over a view to the primary shard in order to obtain the view definition, since it does not currently store view catalog information. This initial query will respect the readPreference. It is only as mongos rewrites the query given the view definition that we erroneously discard the server selection metadata.
- duplicates
-
SERVER-28040 Fix maxTimeMS/readPref/readConcern for sharded view query
- Closed