Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Sharding NYC 2023-03-06
-
154
Description
Currently, mongos internally sets the readPreference to "secondaryPreferred" when forward the command to a shard. That is the readPreference that is used for all steps of metrics calculation (i.e. for the internal aggregate commands). Users may want to specify running the analyzeShardKey command on nodes with a certain tag (e.g analytics nodes), therefore mongos should not ignore the readPreference specified by the client. However, if the readPreference is not specified, it should continue to use readPreference "secondaryPreferred" instead of the parser default which is "primary".