[SERVER-7674] MoveChunk should allow you to specify a chunk via its bounds Created: 15/Nov/12  Updated: 27/Oct/15  Resolved: 29/Nov/12

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Matulef Assignee: Kevin Matulef
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DOCS-990 Document bounds parameter of moveChunk Closed
Related
related to SERVER-2001 option to hash shard key Closed
Participants:

 Description   

Right now when you call moveChunk on mongos, you specify a chunk to move via a "find", e.g.

> db.adminCommand({moveChunk : "test.foo" , find : {a : 5} , to : "shard0001"})

The semantics of this are "find the chunk that contains the doc

{a : 5}

, and move it to shard0001."

With hashed shard keys, the chunks are ranges of hashes, so a single chunk might be from say

{ "a" : NumberLong("8234") }

-->>

{ "a" : NumberLong("9543") }

. Right now there's no way to specify this particular chunk unless you use a doc whose 'a' value hashes to somewhere in the range [8234,9543).

As alternative to the "find" syntax, moveChunk should also allow you to specify a chunk via its upper and lower bounds, as with the following syntax:

> db.adminCommand({moveChunk : "test.foo" , bounds : [ {a : NumberLong("8234")} , { "a" : NumberLong("9543") } ] , to : "shard0001"})

This allows the user to be very explicit about which chunk they want to move (the command would just return an error if no chunk with those upper and lower bounds exists).



 Comments   
Comment by auto [ 29/Nov/12 ]

Author:

{u'date': u'2012-11-29T18:30:23Z', u'email': u'matulef@10gen.com', u'name': u'Kevin Matulef'}

Message: SERVER-7674 add option to specify a chunk via its bounds
Branch: master
https://github.com/mongodb/mongo/commit/a54fd9e2707aa441a449a5cfe41c230ebc8ff80a

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