Make analyzeShardKey command respect client readPreference in all steps of metrics calculation

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Sharding NYC 2023-03-06
    • 154
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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".  

            Assignee:
            Cheahuychou Mao
            Reporter:
            Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: