[SERVER-58270] Create configureCollectionAutoSplitter command Created: 05/Jul/21  Updated: 29/Oct/23  Resolved: 04/Aug/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Simon Gratzer (Inactive) Assignee: Simon Gratzer (Inactive)
Resolution: Fixed Votes: 0
Labels: PM-2321-Balancer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
causes SERVER-70768 balancer use wrong chunk size for jum... Closed
Related
related to SERVER-56464 Allow to disable/enable autosplit per... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2021-07-12, Sharding EMEA 2021-07-26, Sharding EMEA 2021-08-09
Participants:

 Description   

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


 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 30/Jul/21 ]

Author:

{'name': 'Simon Graetzer', 'email': 'simon.gratzer@mongodb.com'}

Message: SERVER-58270 Create configureCollectionAutoSplitter command
Branch: master
https://github.com/mongodb/mongo/commit/66708080ab5db302558f7bd33293167d181f3858

Generated at Thu Feb 08 05:44:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.