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

command to change shard key of a collection

    Details

      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
          lizhenyu2000 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
          lizhenyu2000 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
          AnneTheAgile Anne Moroney added a comment -

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

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

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

          Show
          tubededentifrice Vincent added a comment - @Anne Nope I didn't, I thought this would be enough
          Hide
          AnneTheAgile 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
          AnneTheAgile 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
          tubededentifrice Vincent added a comment -
          Show
          tubededentifrice 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:
                32 weeks, 4 days ago
                Date of 1st Reply: