[SERVER-78182] analyzeShardKey command should fail if only keyCharacteristics is requested and the shard key doesn't have a supporting index Created: 16/Jun/23  Updated: 29/Oct/23  Resolved: 19/Jun/23

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

Type: Task 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:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0
Sprint: Sharding NYC 2023-06-26
Participants:

 Description   

If the analyzeShardKey command is run with keyCharacteristics: true and readWriteDistribution: false and the shard key does not have a supporting index, there is no metrics to return. The command would fail with an IllegalOperation error with the message like “Cannot analyze the characteristics of a shard key that doesn't have a supporting index” instead of returning an empty response. 



 Comments   
Comment by Githook User [ 19/Jun/23 ]

Author:

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

Message: SERVER-78182 analyzeShardKey command should fail if only keyCharacteristics is requested and the shard key doesn't have a supporting index

(cherry picked from commit cbc22e2ff9c5ac20ee57513e108412c1e1331e8e)
Branch: v7.0
https://github.com/mongodb/mongo/commit/a9aa70fa44fcf64ba44b0c02131539bd3feee0e5

Comment by Githook User [ 19/Jun/23 ]

Author:

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

Message: SERVER-78182 analyzeShardKey command should fail if only keyCharacteristics is requested and the shard key doesn't have a supporting index
Branch: master
https://github.com/mongodb/mongo/commit/cbc22e2ff9c5ac20ee57513e108412c1e1331e8e

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