[SERVER-8187] Usability issues with splitting + hashed shard keys Created: 15/Jan/13 Updated: 27/Oct/15 Resolved: 01/Feb/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 2.4.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristina Chodorow (Inactive) | Assignee: | Randolph Tan |
| Resolution: | Done | 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 | ||||||||||||||||||||||||
| Steps To Reproduce: | 5 shards, create a hashed shard key on user_id, populate with 1 million docs of the form {user_id:"user"+Math.floor(Math.random()*10000), date:new Date(), something:Math.random()}. Try to move a chunk. |
||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Description |
|
It seems difficult to split a chunk that is too big to move when using a hashed shard key. splitFind claimed to split it, but didn't:
split+middle gave the fantabulous error message:
(NumberLong("6236905156946055959") was chosen randomly, just in case you could pass in a hashed value and have it work). It also seems easy to end up in this situation: I randomly populated a collection with 1 million docs and a 1MB chunk chunk size and no chunk I've tried so far has been small enough to move. |
| Comments |
| Comment by auto [ 01/Feb/13 ] | |
|
Author: {u'date': u'2013-01-25T23:35:51Z', u'email': u'randolph@10gen.com', u'name': u'Randolph Tan'}Message: Added new option for splitting keys on a cluster using hashed shard keys. | |
| Comment by Randolph Tan [ 01/Feb/13 ] | |
|
We decided to be paranoid and require the user to specify both bounds. This is also consistent with the new bounds option for moveChunk. | |
| Comment by Kristina Chodorow (Inactive) [ 01/Feb/13 ] | |
|
Why do we need to specify upper and lower bound here? Isn't a chunk uniquely specified by its lower bound? | |
| Comment by Randolph Tan [ 01/Feb/13 ] | |
|
New option for moveChunk: bounds. The bounds accepts an array with two elements, which specifies the bounds of the chunk to split. Ex:
Note: bounds cannot be used together with middle or find. Bounds is useful for splitting a chunk with hashed shard keys. | |
| Comment by Greg Studer [ 25/Jan/13 ] | |
|
@kristina - see | |
| Comment by Kristina Chodorow (Inactive) [ 17/Jan/13 ] | |
|
There's one more issue (that maybe should be a new ticket): I used a single mongos for all inserts, but all of the chunks were too big to move. Shouldn't mongos have split the chunks more on insert? | |
| Comment by Kristina Chodorow (Inactive) [ 16/Jan/13 ] | |
|
It would be nice to be able to specify a chunk and just have mongod find a split point for it. |