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

Set default value of numInitialChunks in reshardCollection to 90

    • Cluster Scalability
    • Fully Compatible
    • v8.0, v7.3, v7.0, v6.0
    • Cluster Scalability Priorities
    • 200

      Using a default value of 90 will help prevent the following scenarios:
      1. Starting in 6.0.3, when a collection is sharded, we only create 1 chunk. The auto-splitter only splits a chunk when it can be moved to another shard. If a collection is resharded when it has only 1 chunk, resharding only asks to create 1 chunk here which leads to all the data being written to one shard.
      2. Resharding uses $sample to find numInitialChunks * 10 number of documents to find split points for the collection. In clusters with lower number of numInitialChunks, the number of sampled documents is often not enough to determine a good distribution of the collection. This leads to uneven distribution of data after resharding and chunk migration has to kick in to balance data equally.

      3. For clusters with a very large value of numInitialChunks (default is existing number of chunks in the collection), getMore for $sample can give out of memory errors or $sample is unable to find enough unique documents by shard key.

            Assignee:
            abdul.qadeer@mongodb.com Abdul Qadeer
            Reporter:
            ratika.gandhi@mongodb.com Ratika Gandhi
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: