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

Create configureCollectionAutoSplitter command

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Sharding EMEA 2021-07-12, Sharding EMEA 2021-07-26, Sharding EMEA 2021-08-09

      New balancer per-collection command configureCollectionAutoSplitter to configure both the default chunk size and the auto-splitting behaviour, rather than doing direct writes against config.settings. The global cluster configuration in config.settings will remain as well, but any configuration done by this command will override the global cluster settings. The command will have the following parameters:

      • configureCollectionAutoSplitter (string): db.collection to which to apply the configuration
      • defaultChunkSize (int, optional): The new default chunk size in MB. If the new default chunk size is smaller than what it currently is, just sets the new value, but doesn’t perform any splits; if the new default chunk size is the same or larger than what it currently is, consults the defragment parameter below for decision whether to start defragmentation for that collection.
      • balancerShouldMergeChunks (bool, optional defaults to false): Can be specified when increasing or specifying the same defaultChunkSize. If set to true, will put the collection in a “defragmentation” mode whereby the balancer will merge and move chunks around in order to yield a number of chunks approximately equal to the TotalDataSize/DefaultChunkSize evenly distributed across the appropriate shards. The defragmentation is a one-time operation (which potentially may take a long time) and after that the collection will leave the “defragmentation” mode. Its progress will be able to be monitored from the return of the balancerCollectionStatus command.

      enableAutoSplitter (bool, optional): Specifies whether the auto-splitter should be running or not for this collection.

      Authorisation

      The new command’s authorisation will exactly mimic that of the move/split/merge commands and will use the splitChunk action and additionally use the moveChunk action if balancerShouldMergeChunks is set to true

      Example Use Cases

      • User wants to turn on/off autosplitting for a specific collection:
      • configureCollectionAutoSplitter: “db.collection”, autoSplit: true/false
      • User wants to increase to increase default chunk size but not merge chunks (routing table size will remain the same):
      • configureCollectionAutoSplitter: “db.collection”, defaultChunkSize: 256, mergeChunks:false
      • User wants to merge small chunks (routing table size shrinks):
      • configureCollectionAutoSplitter: “db.collection”, mergeChunks:true

            Assignee:
            simon.gratzer@mongodb.com Simon Gratzer (Inactive)
            Reporter:
            simon.gratzer@mongodb.com Simon Gratzer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: