Skip to content

Commit 9ebb595

Browse files
authored
DOCSP-50630 forwardport numInitialChunks Removal (#12356) (#12366)
* DOCSP-50630 forwardport numInitialChunks Removal * *
1 parent d04baa8 commit 9ebb595

File tree

4 files changed

+10
-89
lines changed

4 files changed

+10
-89
lines changed

content/manual/manual/source/core/sharding-data-partitioning.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ Empty Collection
6767
entire range of the shard key values and performs an initial
6868
chunk distribution. By default, the
6969
operation creates 2 chunks per shard and migrates across the
70-
cluster. You can use ``numInitialChunks`` option to specify a
71-
different number of initial chunks. This initial creation and
72-
distribution of chunks allows for faster setup of
73-
sharding.
70+
cluster.
7471

7572
- After the initial distribution, the balancer manages the chunk
7673
distribution going forward.

content/manual/manual/source/reference/command/shardCollection.txt

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ The command has the following form:
5858
shardCollection: "<database>.<collection>",
5959
key: { <field1>: <1|"hashed">, ... },
6060
unique: <boolean>,
61-
numInitialChunks: <integer>,
6261
presplitHashedZones: <boolean>,
6362
collation: { locale: "simple" },
6463
timeseries: <object>
@@ -113,33 +112,6 @@ The command takes the following fields:
113112

114113
You cannot specify ``true`` when using :ref:`hashed shard keys
115114
<sharding-hashed>`.
116-
117-
* - ``numInitialChunks``
118-
- integer
119-
- Specifies the initial number of chunks to create across all shards in
120-
the cluster when sharding an *empty* collection with a
121-
:ref:`hashed shard key <sharding-hashed-sharding>`. MongoDB
122-
will then create and balance chunks across the cluster. The
123-
``numInitialChunks`` must result in less than ``8192`` per shard.
124-
125-
If the collection is not empty or the shard key does not
126-
contain a hashed field, the operation returns an error.
127-
128-
- If sharding with :ref:`presplitHashedZones: true
129-
<cmd-shard-collection-presplitHashedZones>`,
130-
MongoDB attempts to evenly distribute the specified
131-
number of chunks across the zones in the cluster.
132-
133-
- If sharding with :ref:`presplitHashedZones: false
134-
<cmd-shard-collection-presplitHashedZones>` or omitted and
135-
no zones and zone ranges are defined for the empty
136-
collection, MongoDB attempts to evenly distributed the
137-
specified number of chunks across the shards in the cluster.
138-
139-
- If sharding with :ref:`presplitHashedZones: false
140-
<cmd-shard-collection-presplitHashedZones>` or omitted and
141-
zones and zone ranges have been defined for the empty
142-
collection, ``numInitialChunks`` has no effect.
143115

144116
* - ``collation``
145117
- document
@@ -269,11 +241,6 @@ Zone Sharding and Initial Chunk Distribution
269241

270242
.. include:: /includes/extracts/zoned-sharding-shard-operation-chunk-distribution-with-links.rst
271243

272-
See :ref:`pre-define-zone-range-example` for an example. If sharding a
273-
collection using a ranged or single-field hashed shard key, the
274-
``numInitialChunks`` option has no effect if zones and zone ranges have
275-
been defined for the empty collection.
276-
277244
To shard a collection using a :ref:`compound hashed index
278245
<index-type-compound-hashed>`, see
279246
:ref:`shardCollection-zones-compound-hashed`.
@@ -285,11 +252,6 @@ Zone Sharding and Compound Hashed Indexes
285252

286253
.. include:: /includes/extracts/zoned-sharding-shard-operation-chunk-distribution-hashed-short.rst
287254

288-
The ``numInitialChunks`` option has no effect if zones and zone ranges
289-
have been defined for the empty collection *and*
290-
:ref:`presplitHashedZones <cmd-shard-collection-presplitHashedZones>` is
291-
``false``.
292-
293255
See :ref:`pre-define-zone-range-hashed-example` for an example.
294256

295257
.. seealso::

content/manual/manual/source/reference/method/sh.shardCollection.txt

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,10 @@ Definition
100100
- document
101101

102102
- Optional. A document containing optional fields, including
103-
``numInitialChunks`` and ``collation``.
104-
105-
106-
107-
103+
``collation``.
108104

109105
The ``options`` argument supports the following options:
110106

111-
112107
.. list-table::
113108
:header-rows: 1
114109
:widths: 20 20 80
@@ -119,36 +114,6 @@ Definition
119114

120115
- Description
121116

122-
* - ``numInitialChunks``
123-
124-
- integer
125-
126-
- Optional. Specifies the minimum number of chunks to create
127-
initially when sharding an *empty* collection with a
128-
:ref:`hashed shard key <sharding-hashed-sharding>`. MongoDB
129-
then creates and balances chunks across the cluster. The
130-
``numInitialChunks`` parameter must be less than ``8192`` chunks per shard.
131-
Defaults to ``2`` chunks per shard.
132-
133-
If the collection is not empty or the shard key does not
134-
contain a hashed field, the operation returns an error.
135-
136-
- If sharding with :ref:`presplitHashedZones: true
137-
<method-shard-collection-presplitHashedZones>`,
138-
MongoDB attempts to evenly distribute the specified
139-
number of chunks across the zones in the cluster.
140-
141-
- If sharding with :ref:`presplitHashedZones: false
142-
<method-shard-collection-presplitHashedZones>` or omitted and
143-
no zones and zone ranges are defined for the empty
144-
collection, MongoDB attempts to evenly distributed the
145-
specified number of chunks across the shards in the cluster.
146-
147-
- If sharding with :ref:`presplitHashedZones: false
148-
<method-shard-collection-presplitHashedZones>` or omitted and
149-
zones and zone ranges have been defined for the empty
150-
collection, ``numInitialChunks`` has no effect.
151-
152117
* - ``collation``
153118

154119
- document
@@ -286,11 +251,6 @@ Zone Sharding and Initial Chunk Distribution
286251

287252
.. include:: /includes/extracts/zoned-sharding-shard-operation-chunk-distribution-with-links.rst
288253

289-
See :ref:`pre-define-zone-range-example` for an example. If sharding a
290-
collection using a ranged or single-field hashed shard key, the
291-
``numInitialChunks`` option has no effect if zones and zone ranges have
292-
been defined for the empty collection.
293-
294254
To shard a collection using a :ref:`compound hashed index
295255
<index-type-compound-hashed>`, see
296256
:ref:`sh.shardCollection-zones-compound-hashed`.
@@ -302,11 +262,6 @@ Initial Chunk Distribution with Compound Hashed Indexes
302262

303263
.. include:: /includes/extracts/zoned-sharding-shard-operation-chunk-distribution-hashed-short.rst
304264

305-
The ``numInitialChunks`` option has no effect if zones and zone ranges
306-
have been defined for the empty collection *and*
307-
:ref:`presplitHashedZones <method-shard-collection-presplitHashedZones>`
308-
is ``false``.
309-
310265
See :ref:`pre-define-zone-range-hashed-example` for an example.
311266

312267
.. seealso::
@@ -364,7 +319,6 @@ following example uses
364319
{ last_name: "hashed" },
365320
false,
366321
{
367-
numInitialChunks: 5,
368322
collation: { locale: "simple" }
369323
}
370324
)

content/manual/manual/source/release-notes/8.0.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,14 @@ output:
762762

763763
.. include:: /includes/plan-cache-rename.rst
764764

765+
numInitialChunks Option Removed
766+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
767+
768+
Starting in MongoDB 7.2, the ``numInitialChunks`` option is removed from the
769+
:dbcommand:`shardCollection` command. The server automatically creates
770+
chunks on every shard in a cluster when using :ref:`hashed sharding
771+
<sharding-hashed>` for an empty collection.
772+
765773
Parameter Filtering
766774
~~~~~~~~~~~~~~~~~~~
767775

0 commit comments

Comments
 (0)