Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7674

MoveChunk should allow you to specify a chunk via its bounds

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.2
    • Component/s: Sharding
    • Labels:
      None

      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).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: