[SERVER-4246] allow resharding by more-specific shard key. Created: 10/Nov/11  Updated: 06/Dec/22  Resolved: 30/Jul/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Greg Studer Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Done Votes: 10
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-4000 command to change shard key of a coll... Closed
is related to SERVER-9845 Command to unshard a collection Closed
Assigned Teams:
Sharding
Participants:

 Description   

While sharding by a different shard key in general could require arbitrary amounts of data movement, sharding by a more-specific shard key doesn't have this problem. For example, a collection might initially be sharded by "region", then suddenly one region is huge, and the data must be resharded to split the regional chunks. Even though no data needs to be moved between shards, this isn't allowed.

If we were nicer, we could allow this by creating indices on each shard for the new shard key, then modifying the config db and appending criteria to the chunk bounds.



 Comments   
Comment by Garaudy Etienne [ 30/Jul/21 ]

We introduced refineCollection in MongoDB 4.4

Generated at Thu Feb 08 03:05:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.