[SERVER-76719] analyzeShardKey command can return incorrect monotonicity for compound hashed shard keys Created: 01/May/23 Updated: 29/Oct/23 Resolved: 02/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1 |
| 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: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v7.0
|
||||||||
| Sprint: | Sharding NYC 2023-05-15 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 0 | ||||||||
| Description |
|
Currently, shard keys with a hashed field are handled as follows. If the number of fields is 1, then the analyzeShardKey command would just return "not monotonic". If the number of fields is > 1, the command would instead try to infer its monotonicity from the correlation coefficient of the recordIds. The latter is incorrect since hashing introduces randomness so it is meaningless to calculate the correlation coefficient of recordIds in a hashed index. According to BF-28591, this is causing a monotonic shard key to be reported as "not monotonic" and vice versa. |
| Comments |
| Comment by Githook User [ 02/May/23 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}Message: (cherry picked from commit 2a4172c5251901b2ab725e829d55b52eae6bb3aa) |
| Comment by Githook User [ 01/May/23 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}Message: |