[SERVER-6069] maxChunksize error when using 'find' instead of 'middle' with the 'split' command. Created: 11/Jun/12 Updated: 11/Jul/16 Resolved: 06/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | q | Assignee: | Greg Studer |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux (virtual) #28-Ubuntu SMP Fri Jan 27 18:22:35 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux Description: Ubuntu 11.10 Total of four ec2 instances with the following configuration: Using the mongodb-10gen repo from apt-get. |
||
| Operating System: | OS X |
| Participants: |
| Description |
|
Issue is while trying to pre-split a chunk on a sharded collection using the 'find', 'to' split options. Using the 'middle' option works as shown below: MongoDB shell version: 2.0.6 mongos> use admin ); { "ok" : 1 }mongos> db.runCommand({'shardcollection': 'test.test', key: {'key1': 1, 'key2': 1}}); { "collectionsharded" : "test.test", "ok" : 1 }mongos> db.runCommand({split: 'test.test', find: { 'key1': 1, 'key2': 1 }, to: { 'key1': 6, 'key2': 6 }}); ", , to: { 'key1': 5, 'key2': 5 }, maxChunkSize: 16}); ", I've also tried increasing and decreasing the chunk size from the config db with no changes to the above error message. |
| Comments |
| Comment by Jenna deBoisblanc [ 09/Oct/12 ] | |||||
|
Using 2.2.0 db.runCommand( { split : "oct9.oct9" , find : { name: "Isaac" }} ) fails if oct9 is an empty collection. Error message:
using "middle" instead of "find" works. | |||||
| Comment by q [ 13/Jun/12 ] | |||||
|
My misunderstanding. Thanks for the explanation. | |||||
| Comment by Greg Studer [ 12/Jun/12 ] | |||||
|
The error message is wrong - but think this is undefined behavior - "to" is not a documented option in the split command. http://www.mongodb.org/display/DOCS/Splitting+Shard+Chunks There's no need to specify a "to" field because a split always breaks an existing chunk into two parts, by splitting at one point. The initial chunk is $MinKey->$MaxKey. Think the desired behavior here is just : db.runCommand({split: 'test.test', middle: { 'key1': 1, 'key2': 1 } }) }) | |||||
| Comment by Eliot Horowitz (Inactive) [ 12/Jun/12 ] | |||||
|
Was there any data in the collection? |