Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15728

[Server] Add warning to sh.moveChunk that this method should not be used with a hashed shard key

    XMLWordPrintableJSON

Details

    Description

      The move chunk command can be used either with a query option or a bounds option. The query option should be used for regular shard keys while bounds should be used for hashed shard keys. This is already documented correctly in the moveChunk page of the docs.

      The sh.moveChunk helper only allows the use of the query option. This isn't really documented well, and so users that go to this page rather than the moveChunk page often don't realize that sh.moveChunk should not be used with hashed shard keys.

      I propose adding a warning to the description of the command. The first paragraph can be changed by adding to the end something similar to: "This command uses the find option from the moveChunk command, and should not be used for hashed shard keys. To move a chunk with a hashed shard key, use the moveChunk command specifying the bounds field."

      Attachments

        Activity

          People

            lindsey.moore@mongodb.com Lindsey Moore
            allison.easton@mongodb.com Allison Easton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 2 weeks, 6 days ago