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

Add functionality to pick new split points during resharding when zones are defined

    • 1

      Add a new subclass of InitialSplitPolicy (perhaps subclass AbstractTagsBasedSplitPolicy) that will pick split points and create chunks for the new shard key based on the zones passed in to the resharding command and the existing data in the collection.

      This class should first create a chunk covering the range of each zone passed into the command and create chunks that cover any gaps between the defined zones.

      i.e. for a shard key {x: 1} 
      
      // if a user passes in:
      zones: [{zone1, min: {x: -100}, max: {x: 0}}, {zone2, min: {x: 10}, max: {x: 100}}]
      
      // create chunks covering the two zone ranges and the gaps in the shard key range:
      [{min: {x: minKey}, max: {x: -100}}, // this covers the gap from min value of the shard key range (minKey) to the min of zone1
      {min: {x: -100}, max: {x: 0}} // this covers zone1
      {min: {x: 0}, max: {x: 10}}, // this covers the gap between zone1 and zone2
      {min: {x: 10}, max: {x: 100}}, // this covers zone2
      {min: {x: 100}, max: {x: maxKey}}] // this covers the gap from the max of zone2 to the max value of the shard key range (maxKey)
      

      If the number of chunks created above using the defined zone ranges is greater than or equal to numInitialChunks, then we do not have to split any further and return these chunks.

      If the number of chunks created is less than numInitialChunks, we will need to sample documents to pick more split points using the same agg pipeline defined in SERVER-49510.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: