[SERVER-74417] Make analyzeShardKey command respect client readPreference in all steps of metrics calculation Created: 27/Feb/23  Updated: 29/Oct/23  Resolved: 03/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding NYC 2023-03-06
Participants:
Linked BF Score: 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".  



 Comments   
Comment by Githook User [ 03/Mar/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-74417 Make analyzeShardKey command respect client readPreference in all steps of metrics calculation
Branch: master
https://github.com/mongodb/mongo/commit/719371d412fc1af89dc477eee884f65887a22e7f

Comment by Githook User [ 02/Mar/23 ]

Author:

{'name': 'Uladzimir Makouski', 'email': 'uladzimir.makouski@mongodb.com', 'username': 'umakouski'}

Message: Revert "SERVER-74417 Make analyzeShardKey command respect client readPreference in all steps of metrics calculation"

This reverts commit e3632627ff845c0516974f5c45163284cc1962d1.
Branch: master
https://github.com/mongodb/mongo/commit/b960941f0e9b86bd7c75121b343b03c20d72489e

Comment by Githook User [ 02/Mar/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-74417 Make analyzeShardKey command respect client readPreference in all steps of metrics calculation
Branch: master
https://github.com/mongodb/mongo/commit/e3632627ff845c0516974f5c45163284cc1962d1

Generated at Thu Feb 08 06:27:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.