Core Server
  1. Core Server
  2. SERVER-4000

command to change shard key of a collection

    Details

    • # Replies:
      13
    • Last comment by Customer:
      true

      Description

      Changing shard keys is fundamentally very expensive, but a helper to do this would be useful. The main thing needed would be to do the operation with good parallelism.

      first cut might require the source collection be read only during the operation.

      might do something like

      • measure what the new distribution would be like by looking at a sampled set of records from the originating collection
      • presplit based on statistics above
      • cluster wide copy of data from src to dest collection
      • build the index(es) for dest after the copy to make things as fast as possible

      i suppose this is just a better version of cloneCollection which we'll want anyway.

        Issue Links

          Activity

          Hide
          Zhenyu Li
          added a comment -

          I wish there is tool to change the shard key and re-distribute a large amount of data (in TB range). I know you guys can figure this out

          Show
          Zhenyu Li
          added a comment - I wish there is tool to change the shard key and re-distribute a large amount of data (in TB range). I know you guys can figure this out
          Hide
          Anne Moroney
          added a comment -

          @Vincent, that idea of 'unshard-if-one-shard' sounds good. Did you make a ticket for it?

          Show
          Anne Moroney
          added a comment - @Vincent, that idea of 'unshard-if-one-shard' sounds good. Did you make a ticket for it?
          Hide
          Vincent
          added a comment -

          @Anne Nope I didn't, I thought this would be enough

          Show
          Vincent
          added a comment - @Anne Nope I didn't, I thought this would be enough
          Hide
          Anne Moroney
          added a comment -

          @Vincent, it might be a good idea since this ticket may possibly eventually get implemented in the full version.

          Show
          Anne Moroney
          added a comment - @Vincent, it might be a good idea since this ticket may possibly eventually get implemented in the full version.
          Hide
          Vincent
          added a comment -
          Show
          Vincent
          added a comment - @Anne, done => https://jira.mongodb.org/browse/SERVER-16264

            People

            • Votes:
              17 Vote for this issue
              Watchers:
              24 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since reply:
                14 weeks, 3 days ago
                Date of 1st Reply: