Skip to content

Commit 2124d28

Browse files
jmd-mongojason-price-mongodbjason-price-mongodb
authored
DOCS-15397 autosplit-update (#1842) (#2282)
* DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update * DOCS-15397-autosplit-update Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: jason-price-mongodb <[email protected]>
1 parent 215f670 commit 2124d28

16 files changed

+118
-58
lines changed

source/core/sharding-data-partitioning.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Populated Collection
4545
Empty Collection
4646
~~~~~~~~~~~~~~~~
4747

48-
- If you define :doc:`zones and zone ranges </core/zone-sharding>` defined
48+
- If you define :ref:`zones and zone ranges <zone-sharding>` defined
4949
for an empty or non-existing collection (Available starting in
5050
MongoDB 4.0.3):
5151

@@ -59,7 +59,7 @@ Empty Collection
5959
distribution going forward.
6060

6161

62-
- If you do not have :doc:`zones and zone ranges </core/zone-sharding>` defined
62+
- If you do not have zones and zone ranges defined
6363
for an empty or non-existing collection:
6464

6565
- For hashed sharding:
@@ -165,8 +165,7 @@ begins migrating data across the cluster to ensure an even distribution.
165165

166166
You can :ref:`manage <sharded-cluster-balancer>` certain aspects of the
167167
balancer. The balancer also respects any :term:`zones <zone>` created as
168-
a part of configuring :ref:`zones <zone-sharding>` in a sharded
169-
cluster.
168+
a part of configuring zones in a sharded cluster.
170169

171170
See :ref:`sharding-balancing` for more information on the
172171
:term:`balancer`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Starting in MongoDB 6.0, the following auto-splitting commands do not
2+
perform an operation:
3+
4+
- :method:`sh.enableAutoSplit()`
5+
- :method:`sh.disableAutoSplit()`

source/includes/extracts-4.2-changes.yaml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,10 @@ content: |
532532
---
533533
ref: 4.2-changes-balancer-autosplit
534534
content: |
535-
Starting in MongoDB 4.2:
535+
536+
.. include:: /includes/autosplit-no-operation.rst
537+
538+
In MongoDB versions earlier than 6.0:
536539
537540
- The :dbcommand:`balancerStart` command and the
538541
``mongo`` shell helper methods
@@ -558,13 +561,19 @@ content: |
558561
---
559562
ref: 4.2-changes-start-balancer-autosplit
560563
content: |
561-
Starting in MongoDB 4.2, :method:`sh.startBalancer()` also enables
562-
auto-splitting for the sharded cluster.
564+
565+
.. include:: /includes/autosplit-no-operation.rst
566+
567+
In MongoDB versions earlier than 6.0, :method:`sh.startBalancer()`
568+
also enables auto-splitting for the sharded cluster.
563569
---
564570
ref: 4.2-changes-stop-balancer-autosplit
565571
content: |
566-
Starting in MongoDB 4.2, :method:`sh.stopBalancer()` also disables
567-
auto-splitting for the sharded cluster.
572+
573+
.. include:: /includes/autosplit-no-operation.rst
574+
575+
In MongoDB versions earlier than 6.0, :method:`sh.stopBalancer()`
576+
also disables auto-splitting for the sharded cluster.
568577
---
569578
ref: 4.2-changes-global-lock-reporting
570579
content: |

source/reference/command/balancerStart.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ Definition
1818
Starts the balancer thread. The command does not wait for a
1919
balancing round to start.
2020

21-
Starting in MongoDB 4.2, the command enables auto-splitting for the
22-
sharded cluster. To disable auto-splitting when the balancer is
23-
enabled, you can use :method:`sh.disableAutoSplit()`.
24-
21+
.. include:: /includes/autosplit-no-operation.rst
22+
23+
In MongoDB versions earlier than 6.0, the command enables
24+
auto-splitting for the sharded cluster. To disable auto-splitting
25+
when the balancer is enabled, you can use
26+
:method:`sh.disableAutoSplit()`.
27+
2528
Syntax
2629
------
2730

source/reference/command/balancerStop.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ Definition
1818
Disables the balancer in a sharded cluster. If a balancing round is
1919
in progress, the operation waits for balancing to complete.
2020

21-
Starting in MongoDB 4.2, the command disables auto-splitting for the
22-
sharded cluster. To enable auto-splitting when the balancer is
23-
disabled, you can use :method:`sh.enableAutoSplit()`.
24-
2521
You can only issue the :dbcommand:`balancerStop` against the
2622
``admin`` database on a :binary:`~bin.mongos` instance.
2723

24+
.. include:: /includes/autosplit-no-operation.rst
25+
26+
In MongoDB versions earlier than 6.0, the command disables
27+
auto-splitting for the sharded cluster. To enable auto-splitting when
28+
the balancer is disabled, you can use :method:`sh.enableAutoSplit()`.
29+
2830
Syntax
2931
------
3032

source/reference/config-database.txt

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -384,32 +384,28 @@ to support sharding:
384384
balancer status, see
385385
:doc:`/tutorial/manage-sharded-cluster-balancer`.
386386

387-
Starting in MongoDB 4.2:
388-
389-
- :dbcommand:`balancerStart` also enables auto-splitting for the sharded cluster.
390-
391-
- :dbcommand:`balancerStop` also disables auto-splitting for the sharded cluster.
392-
393-
- Autosplit. To enable or disable the autosplit flag, use the
394-
corresponding :method:`sh.enableAutoSplit()` method or
395-
:method:`sh.disableAutoSplit()` method.
387+
- Autosplit:
388+
389+
.. include:: /includes/autosplit-no-operation.rst
396390

397-
Starting in MongoDB 4.2:
391+
In MongoDB versions earlier than 6.0:
398392

399393
- :dbcommand:`balancerStart` also enables auto-splitting for the
400394
sharded cluster.
401395

402396
- :dbcommand:`balancerStop` also disables auto-splitting for the
403397
sharded cluster.
398+
399+
- To enable or disable the autosplit flag, use the corresponding
400+
:method:`sh.enableAutoSplit()` method or
401+
:method:`sh.disableAutoSplit()` method.
404402

405-
The following are some example documents in the ``settings``
406-
collection:
403+
Example documents in the ``settings`` collection:
407404

408405
.. code-block:: javascript
409406

410407
{ "_id" : "chunksize", "value" : 64 }
411408
{ "_id" : "balancer", "mode" : "full", "stopped" : false }
412-
{ "_id" : "autosplit", "enabled" : true }
413409

414410
.. data:: config.shards
415411

source/reference/method.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,14 @@ Sharding
967967

968968
- Disables auto-splitting for the sharded cluster.
969969

970+
.. include:: /includes/autosplit-no-operation.rst
971+
970972
* - :method:`sh.enableAutoSplit()`
971973

972974
- Enables auto-splitting for the sharded cluster.
973975

976+
.. include:: /includes/autosplit-no-operation.rst
977+
974978
* - :method:`sh.enableSharding()`
975979

976980
- Creates a database.

source/reference/method/js-sharding.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ Sharding Methods
6868

6969
- Disables auto-splitting for the sharded cluster.
7070

71+
.. include:: /includes/autosplit-no-operation.rst
72+
7173
* - :method:`sh.enableAutoSplit()`
7274

7375
- Enables auto-splitting for the sharded cluster.
7476

77+
.. include:: /includes/autosplit-no-operation.rst
78+
7579
* - :method:`sh.enableSharding()`
7680

7781
- Creates a database.

source/reference/method/sh.enableAutoSplit.txt

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,27 @@ sh.enableAutoSplit
1010
:depth: 1
1111
:class: singlecol
1212

13+
.. note::
14+
15+
.. include:: /includes/autosplit-no-operation.rst
16+
1317
Description
1418
-----------
1519

1620
.. method:: sh.enableAutoSplit()
1721

18-
Enables auto-splitting for the sharded cluster. Auto-splitting is
19-
enabled by default.
20-
21-
:method:`sh.enableAutoSplit()` enables the autosplit flag in the
22-
:data:`config.settings` collection.
23-
22+
Enables the autosplit flag in the :data:`config.settings`
23+
collection. When auto-splitting is enabled for a sharded cluster,
24+
MongoDB automatically splits chunks based on the shard key values
25+
the chunk represents to keep the chunks from growing too large.
26+
2427
You can only run :method:`sh.enableAutoSplit()` from a
2528
:binary:`~bin.mongosh` session that is connected to a
26-
:binary:`~bin.mongos` instance. :method:`sh.enableAutoSplit()` errors
27-
if run on a :binary:`~bin.mongod` instance.
29+
:binary:`~bin.mongos` instance. :method:`sh.enableAutoSplit()`
30+
errors if run on a :binary:`~bin.mongod` instance.
2831

2932
.. note::
30-
33+
3134
.. include:: /includes/extracts/4.2-changes-start-balancer-autosplit.rst
3235

3336
.. seealso::

source/reference/method/sh.setBalancerState.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ Description
1515

1616
.. method:: sh.setBalancerState(state)
1717

18-
Enables or disables the :term:`balancer`. Starting in MongoDB 4.2,
19-
the method also enables auto-splitting if enabling the balancer and
20-
disables auto-splitting if disabling the balancer.
21-
18+
Enables or disables the :term:`balancer`.
19+
20+
.. include:: /includes/autosplit-no-operation.rst
21+
22+
In MongoDB versions earlier than 6.0, :method:`sh.setBalancerState()`
23+
also enables auto-splitting if enabling the balancer and disables
24+
auto-splitting if disabling the balancer.
25+
2226
Use :method:`sh.getBalancerState()` to determine if the balancer is
2327
currently enabled or disabled and :method:`sh.isBalancerRunning()`
2428
to check its current state.

source/reference/method/sh.startBalancer.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ Definition
1515

1616
.. method:: sh.startBalancer(timeout, interval)
1717

18-
.. versionchanged:: 4.2
18+
.. versionchanged:: 6.0
1919

20-
Starts the balancer in a sharded cluster. Starting in MongoDB 4.2,
21-
:method:`sh.startBalancer()` also enables auto-splitting for the
22-
sharded cluster.
20+
Starts the balancer in a sharded cluster.
2321

24-
The method can take the following options:
22+
.. include:: /includes/autosplit-no-operation.rst
23+
24+
In MongoDB versions earlier than 6.0 :method:`sh.startBalancer()`
25+
also enables auto-splitting for the sharded cluster.
2526

27+
The method can take the following options:
2628

2729
.. list-table::
2830
:header-rows: 1

source/reference/method/sh.stopBalancer.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ Definition
1515

1616
.. method:: sh.stopBalancer(timeout, interval)
1717

18-
.. versionchanged:: 4.2
18+
.. versionchanged:: 6.0
1919

20-
Disables the balancer in a sharded cluster. Starting in MongoDB 4.2,
21-
:method:`sh.stopBalancer()` also disables auto-splitting for the
22-
sharded cluster.
20+
Disables the balancer in a sharded cluster.
2321

24-
The method can take the following options:
22+
.. include:: /includes/autosplit-no-operation.rst
23+
24+
In MongoDB versions earlier than 6.0, :method:`sh.stopBalancer()`
25+
also disables auto-splitting for the sharded cluster.
2526

27+
The method can take the following options:
2628

2729
.. list-table::
2830
:header-rows: 1

source/reference/sharding.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ Sharding Methods in ``mongosh``
6969

7070
- Disables auto-splitting for the sharded cluster.
7171

72+
.. include:: /includes/autosplit-no-operation.rst
73+
7274
* - :method:`sh.enableAutoSplit()`
7375

7476
- Enables auto-splitting for the sharded cluster.
7577

78+
.. include:: /includes/autosplit-no-operation.rst
79+
7680
* - :method:`sh.enableSharding()`
7781

7882
- Creates a database.

source/release-notes/6.0-upgrade-sharded-cluster.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ Upgrade Procedure
427427
If you do not wish to enable auto-splitting while the balancer is
428428
enabled, you must also run :method:`sh.disableAutoSplit()`.
429429

430+
.. include:: /includes/autosplit-no-operation.rst
431+
430432
For more information about re-enabling the balancer, see
431433
:ref:`sharding-balancing-enable`.
432434

source/tutorial/manage-sharded-cluster-balancer.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ Manage Sharded Cluster Balancer
1212
:depth: 1
1313
:class: singlecol
1414

15-
.. versionchanged:: 3.4
16-
17-
The balancer process has moved from the :binary:`~bin.mongos` instances
18-
to the primary member of the config server replica set.
15+
.. versionchanged:: 6.0
1916

2017
This page describes common administrative procedures related
2118
to balancing. For an introduction to balancing, see
2219
:ref:`sharding-balancing`. For lower level information on balancing, see
2320
:ref:`sharding-balancing-internals`.
2421

22+
The balancer process has moved from the :binary:`~bin.mongos` instances
23+
to the primary member of the config server replica set.
24+
2525
Check the Balancer State
2626
------------------------
2727

@@ -74,6 +74,9 @@ details, see :ref:`sharding-range-size`.
7474
Changing the default range size affects ranges that are processes during
7575
migrations and auto-splits but does not retroactively affect all ranges.
7676

77+
Changing the default chunk size affects chunks that are processes during
78+
migrations and auto-splits but does not retroactively affect all chunks.
79+
7780
.. include:: /includes/autosplit-no-operation.rst
7881

7982
To configure default range size, see

source/tutorial/modify-chunk-size-in-sharded-cluster.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,22 @@ To modify the range size, use the following procedure:
4242
{ upsert: true }
4343
)
4444

45-
The allowed range size is between 1 and 1024 megabytes, inclusive.
45+
Modifying the chunk size has several limitations:
46+
47+
- .. include:: /includes/autosplit-no-operation.rst
48+
49+
.. include:: /includes/autosplit-commands.rst
50+
51+
- In MongoDB versions earlier than 6.0, automatic splitting only occurs
52+
for insert or update operations.
53+
54+
- If you lower the chunk size, it may take time for all chunks to split to
55+
the new size.
56+
57+
- Splits cannot be undone.
58+
59+
- If you increase the chunk size, existing chunks grow only through
60+
insertion or updates until they reach the new size.
61+
62+
- The allowed range of the chunk size is between 1 and 1024 megabytes,
63+
inclusive.

0 commit comments

Comments
 (0)