[SERVER-6491] Prevent dropping shard key index when alternative index doesn't exist Created: 17/Jul/12 Updated: 22/May/23 Resolved: 20/Apr/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Sharding |
| Affects Version/s: | 2.0.6, 2.1.2, 2.4.10 |
| Fix Version/s: | 6.0.0-rc2, 6.1.0-rc0, 5.0.19 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Spencer Brody (Inactive) | Assignee: | Randolph Tan |
| Resolution: | Done | Votes: | 2 |
| Labels: | Sharding-EMEA | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v6.0, v5.0
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Sharding 2022-02-21, Sharding 2022-03-07, Sharding NYC 2022-03-21, Sharding NYC 2022-04-04, Sharding NYC 2022-04-18, Sharding 2022-05-02 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 135 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
This leaves you without an index on the shard key, which can have big performance implications, especially on migrations. |
| Comments |
| Comment by Githook User [ 22/May/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}Message: (cherry picked from commit 8ac94fc68d134eaef7fb3815d25e98ef99f034a3) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 25/Apr/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}Message: (cherry picked from commit 77ffcb1d041dd63b9a8b213183c3b075cb5fca57) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 20/Apr/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 16/Mar/22 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Garaudy Etienne [ 31/Jul/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Going to create a cloud ticket, asking them to prevent this by graying out the "drop shard key index" in Atlas when there's no alternative index. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Asya Kamsky [ 24/Jun/20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Note that there is legitimate times when shard key index can be dropped, that's when there is another index that has the shard key field(s) as its prefix. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Gianfranco Palumbo [ 05/Feb/15 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Tested in 2.4.10:
|