Skip to content

Commit c180d50

Browse files
jason-price-mongodbjason-price-mongodbjmd-mongo
authored
DOCS-15979 new-auto-merge-shell-helpers (#3305)
* DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCSP-28090-user-roles-in-aggregations * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * DOCS-15979-new-auto-merge-shell-helpers * external review feedback * fixes const * matt external feedback * matt external feedback --------- Co-authored-by: jason-price-mongodb <[email protected]> Co-authored-by: Joseph Dougherty <[email protected]> Co-authored-by: jmd-mongo <[email protected]>
1 parent 99c653a commit c180d50

16 files changed

+350
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- :dbcommand:`configureCollectionBalancing` command
2+
- :dbcommand:`mergeAllChunksOnShard` command
3+
- :parameter:`autoMergerIntervalSecs` parameter
4+
- :parameter:`autoMergerThrottlingMS` parameter
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
The method takes the following field:
2+
3+
.. list-table::
4+
:header-rows: 1
5+
:widths: 20 10 10 60
6+
7+
* - Field
8+
- Type
9+
- Necessity
10+
- Description
11+
12+
* - ``namespace``
13+
- String
14+
- Required
15+
- Namespace in the format ``"<database>.<collection>"``. Method
16+
enables automatic chunk merges for the supplied namespace.

source/includes/auto-merger-stop.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
When the method runs, it stops the {+auto-merge-upper+}. Any in
2+
progress operations issued by the {+auto-merge-upper+} are completed.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
To set the time intervals for automatic chunk merges, use these
2+
parameters:
3+
4+
- :parameter:`autoMergerIntervalSecs`
5+
- :parameter:`autoMergerThrottlingMS`

source/includes/disableAutoMerger.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Disables automatic :term:`chunk` merges for a :term:`namespace`.

source/includes/enableAutoMerger.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enables automatic :term:`chunk` merges for a :term:`namespace`.

source/includes/startAutoMerger.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enables the :ref:`{+auto-merge-upper+} <automerger-concept>`.

source/includes/stopAutoMerger.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Disables the :ref:`{+auto-merge-upper+} <automerger-concept>`.

source/reference/method.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,12 +963,24 @@ Sharding
963963

964964
- Activates the sharded collection balancer process if previously disabled using :method:`sh.disableBalancing()`.
965965

966+
* - :method:`sh.disableAutoMerger()`
967+
968+
- .. include:: /includes/disableAutoMerger.rst
969+
970+
.. versionadded:: 7.0
971+
966972
* - :method:`sh.disableAutoSplit()`
967973

968974
- Disables auto-splitting for the sharded cluster.
969975

970976
.. include:: /includes/autosplit-no-operation.rst
971977

978+
* - :method:`sh.enableAutoMerger()`
979+
980+
- .. include:: /includes/enableAutoMerger.rst
981+
982+
.. versionadded:: 7.0
983+
972984
* - :method:`sh.enableAutoSplit()`
973985

974986
- Enables auto-splitting for the sharded cluster.
@@ -1034,6 +1046,12 @@ Sharding
10341046

10351047
- Divides an existing :term:`chunk` that contains a document matching a query into two approximately equal chunks.
10361048

1049+
* - :method:`sh.startAutoMerger()`
1050+
1051+
- .. include:: /includes/startAutoMerger.rst
1052+
1053+
.. versionadded:: 7.0
1054+
10371055
* - :method:`sh.startBalancer()`
10381056

10391057
- Enables the :term:`balancer` and waits for balancing to start.
@@ -1042,6 +1060,12 @@ Sharding
10421060

10431061
- Reports on the status of a :term:`sharded cluster`, as :method:`db.printShardingStatus()`.
10441062

1063+
* - :method:`sh.stopAutoMerger()`
1064+
1065+
- .. include:: /includes/stopAutoMerger.rst
1066+
1067+
.. versionadded:: 7.0
1068+
10451069
* - :method:`sh.stopBalancer()`
10461070

10471071
- Disables the :term:`balancer` and waits for any in progress balancing rounds to complete.

source/reference/method/js-sharding.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,22 @@ Sharding Methods
5656

5757
.. versionadded:: 5.0
5858

59+
* - :method:`sh.disableAutoMerger()`
60+
61+
- .. include:: /includes/disableAutoMerger.rst
62+
63+
.. versionadded:: 7.0
64+
5965
* - :method:`sh.disableBalancing()`
6066

6167
- Disable balancing on a single collection in a sharded database. Does not affect balancing of other collections in a sharded cluster.
6268

69+
* - :method:`sh.enableAutoMerger()`
70+
71+
- .. include:: /includes/enableAutoMerger.rst
72+
73+
.. versionadded:: 7.0
74+
6375
* - :method:`sh.enableBalancing()`
6476

6577
- Activates the sharded collection balancer process if previously disabled using :method:`sh.disableBalancing()`.
@@ -135,6 +147,12 @@ Sharding Methods
135147

136148
- Divides an existing :term:`chunk` that contains a document matching a query into two approximately equal chunks.
137149

150+
* - :method:`sh.startAutoMerger()`
151+
152+
- .. include:: /includes/startAutoMerger.rst
153+
154+
.. versionadded:: 7.0
155+
138156
* - :method:`sh.startBalancer()`
139157

140158
- Enables the :term:`balancer` and waits for balancing to start.
@@ -143,6 +161,12 @@ Sharding Methods
143161

144162
- Reports on the status of a :term:`sharded cluster`, as :method:`db.printShardingStatus()`.
145163

164+
* - :method:`sh.stopAutoMerger()`
165+
166+
- .. include:: /includes/stopAutoMerger.rst
167+
168+
.. versionadded:: 7.0
169+
146170
* - :method:`sh.stopBalancer()`
147171

148172
- Disables the :term:`balancer` and waits for any in progress balancing rounds to complete.
@@ -180,7 +204,9 @@ Sharding Methods
180204
/reference/method/sh.addTagRange
181205
/reference/method/sh.balancerCollectionStatus
182206
/reference/method/sh.commitReshardCollection
207+
/reference/method/sh.disableAutoMerger
183208
/reference/method/sh.disableBalancing
209+
/reference/method/sh.enableAutoMerger
184210
/reference/method/sh.enableBalancing
185211
/reference/method/sh.disableAutoSplit
186212
/reference/method/sh.enableAutoSplit
@@ -198,8 +224,10 @@ Sharding Methods
198224
/reference/method/sh.shardCollection
199225
/reference/method/sh.splitAt
200226
/reference/method/sh.splitFind
227+
/reference/method/sh.startAutoMerger
201228
/reference/method/sh.startBalancer
202229
/reference/method/sh.status
230+
/reference/method/sh.stopAutoMerger
203231
/reference/method/sh.stopBalancer
204232
/reference/method/sh.waitForBalancer
205233
/reference/method/sh.waitForBalancerOff
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
======================
2+
sh.disableAutoMerger()
3+
======================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. method:: sh.disableAutoMerger(namespace)
17+
18+
.. versionadded:: 7.0
19+
20+
.. include:: /includes/disableAutoMerger.rst
21+
22+
``sh.disableAutoMerger()`` is a :binary:`~bin.mongosh` helper method. It
23+
is effectively the same as running the
24+
:dbcommand:`configureCollectionBalancing` command with the
25+
``enableAutoMerger`` field set to ``false``.
26+
27+
.. |dbcommand| replace:: :dbcommand:`configureCollectionBalancing` command
28+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
29+
30+
Syntax
31+
------
32+
33+
.. code-block:: javascript
34+
35+
sh.disableAutoMerger( <namespace> )
36+
37+
Method Field
38+
------------
39+
40+
.. include:: /includes/auto-merger-namespace-field.rst
41+
42+
Behavior
43+
--------
44+
45+
.. include:: /includes/auto-merger-stop.rst
46+
47+
Example
48+
-------
49+
50+
The following example disables automatic chunk merges for
51+
``"testDatabase.myCollection"``. Run the example from
52+
:binary:`~bin.mongos`:
53+
54+
.. code-block:: javascript
55+
56+
sh.disableAutoMerger( "testDatabase.myCollection" )
57+
58+
Learn More
59+
----------
60+
61+
- :ref:`automerger-concept`
62+
- :method:`sh.startAutoMerger()` method
63+
- :method:`sh.stopAutoMerger()` method
64+
- :method:`sh.enableAutoMerger()` method
65+
66+
.. include:: /includes/auto-merger-learn-more.rst
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
=====================
2+
sh.enableAutoMerger()
3+
=====================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. method:: sh.enableAutoMerger(namespace)
17+
18+
.. versionadded:: 7.0
19+
20+
.. include:: /includes/enableAutoMerger.rst
21+
22+
``sh.enableAutoMerger()`` is a :binary:`~bin.mongosh` helper method. It
23+
is effectively the same as running the
24+
:dbcommand:`configureCollectionBalancing` command with the
25+
``enableAutoMerger`` field set to ``true``.
26+
27+
.. |dbcommand| replace:: :dbcommand:`configureCollectionBalancing` command
28+
.. include:: /includes/fact-mongosh-shell-method-alt.rst
29+
30+
Syntax
31+
------
32+
33+
.. code-block:: javascript
34+
35+
sh.enableAutoMerger( <namespace> )
36+
37+
Method Field
38+
------------
39+
40+
.. include:: /includes/auto-merger-namespace-field.rst
41+
42+
Behavior
43+
--------
44+
45+
.. include:: /includes/auto-merger-time-parameters.rst
46+
47+
Example
48+
-------
49+
50+
The following example enables automatic chunk merges for
51+
``"testDatabase.myCollection"``. Run the example from
52+
:binary:`~bin.mongos`:
53+
54+
.. code-block:: javascript
55+
56+
sh.enableAutoMerger( "testDatabase.myCollection" )
57+
58+
Learn More
59+
----------
60+
61+
- :ref:`automerger-concept`
62+
- :method:`sh.disableAutoMerger()` method
63+
- :method:`sh.startAutoMerger()` method
64+
- :method:`sh.stopAutoMerger()` method
65+
66+
.. include:: /includes/auto-merger-learn-more.rst
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
====================
2+
sh.startAutoMerger()
3+
====================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. method:: sh.startAutoMerger()
17+
18+
.. versionadded:: 7.0
19+
20+
.. include:: /includes/startAutoMerger.rst
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: javascript
26+
27+
sh.startAutoMerger()
28+
29+
Behavior
30+
--------
31+
32+
.. include:: /includes/auto-merger-time-parameters.rst
33+
34+
Example
35+
-------
36+
37+
The following example enables the {+auto-merge-upper+}. Run the example
38+
from :binary:`~bin.mongos`:
39+
40+
.. code-block:: javascript
41+
42+
sh.startAutoMerger()
43+
44+
Learn More
45+
----------
46+
47+
- :ref:`automerger-concept`
48+
- :method:`sh.stopAutoMerger()` method
49+
- :method:`sh.enableAutoMerger()` method
50+
- :method:`sh.disableAutoMerger()` method
51+
52+
.. include:: /includes/auto-merger-learn-more.rst
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
===================
2+
sh.stopAutoMerger()
3+
===================
4+
5+
.. default-domain:: mongodb
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
Definition
14+
----------
15+
16+
.. method:: sh.stopAutoMerger()
17+
18+
.. versionadded:: 7.0
19+
20+
.. include:: /includes/stopAutoMerger.rst
21+
22+
Syntax
23+
------
24+
25+
.. code-block:: javascript
26+
27+
sh.stopAutoMerger()
28+
29+
Behavior
30+
--------
31+
32+
.. include:: /includes/auto-merger-stop.rst
33+
34+
Example
35+
-------
36+
37+
The following example disables the {+auto-merge-upper+}. Run the example
38+
from :binary:`~bin.mongos`:
39+
40+
.. code-block:: javascript
41+
42+
sh.stopAutoMerger()
43+
44+
Learn More
45+
----------
46+
47+
- :ref:`automerger-concept`
48+
- :method:`sh.startAutoMerger()` method
49+
- :method:`sh.enableAutoMerger()` method
50+
- :method:`sh.disableAutoMerger()` method
51+
52+
.. include:: /includes/auto-merger-learn-more.rst

0 commit comments

Comments
 (0)