[SERVER-42368] Remove max shard key value size limit Created: 23/Jul/19 Updated: 29/Oct/23 Resolved: 08/Aug/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.3.1 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jack Mulrow | Assignee: | James Heppenstall (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||||||
| Sprint: | Sharding 2019-08-12 | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
Shard key values have a max size limit of 512 bytes which is enforced on mongos when writing new documents (e.g. for inserts) and when validating the split points when committing a chunk split. Because of this, if a user refined the shard key of their collection to include a field all documents have large values for, they would be unable split their chunks because all possible split points would be over the limit. To avoid this scenario without scanning the documents in a collection before refining the collection's shard key and now that that limit on index keys has been lifted (PM-284), this limit should be removed. |
| Comments |
| Comment by James Heppenstall (Inactive) [ 12/Aug/19 ] |
|
In https://docs.mongodb.com/manual/core/sharded-cluster-requirements/#sharding-operational-restrictions under 'Sharding Existing Collection Data Size', it should also be mentioned that, with the 512 bytes limit lifted, one might have trouble initially sharding an existing collection that is too large. A workaround for this issue would be to shard the collection with a prefix of the desired shard key and then refine the shard key to the desired key afterwards using the new refineCollectionShardKey command. |
| Comment by Githook User [ 08/Aug/19 ] |
|
Author: {'name': 'Jamie Heppenstall', 'email': 'jamie.heppenstall@mongodb.com', 'username': 'JamesHeppenstall'}Message: |