Skip to content

Commit d04baa8

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

File tree

4 files changed

+10
-89
lines changed

4 files changed

+10
-89
lines changed

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

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

7875
- After the initial distribution, the balancer manages the chunk
7976
distribution going forward.

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

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ The command has the following form:
6161
shardCollection: "<database>.<collection>",
6262
key: { <field1>: <1|"hashed">, ... },
6363
unique: <boolean>,
64-
numInitialChunks: <integer>,
6564
presplitHashedZones: <boolean>,
6665
collation: { locale: "simple" },
6766
timeseries: <object>
@@ -116,33 +115,6 @@ The command takes the following fields:
116115

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

147119
* - ``collation``
148120
- document
@@ -272,11 +244,6 @@ Zone Sharding and Initial Chunk Distribution
272244

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

275-
See :ref:`pre-define-zone-range-example` for an example. If sharding a
276-
collection using a ranged or single-field hashed shard key, the
277-
``numInitialChunks`` option has no effect if zones and zone ranges have
278-
been defined for the empty collection.
279-
280247
To shard a collection using a :ref:`compound hashed index
281248
<index-type-compound-hashed>`, see
282249
:ref:`shardCollection-zones-compound-hashed`.
@@ -288,11 +255,6 @@ Zone Sharding and Compound Hashed Indexes
288255

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

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

298260
.. seealso::

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

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,10 @@ Definition
103103
- document
104104

105105
- Optional. A document containing optional fields, including
106-
``numInitialChunks`` and ``collation``.
107-
108-
109-
110-
106+
``collation``.
111107

112108
The ``options`` argument supports the following options:
113109

114-
115110
.. list-table::
116111
:header-rows: 1
117112
:widths: 20 20 80
@@ -122,36 +117,6 @@ Definition
122117

123118
- Description
124119

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

157122
- document
@@ -289,11 +254,6 @@ Zone Sharding and Initial Chunk Distribution
289254

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

292-
See :ref:`pre-define-zone-range-example` for an example. If sharding a
293-
collection using a ranged or single-field hashed shard key, the
294-
``numInitialChunks`` option has no effect if zones and zone ranges have
295-
been defined for the empty collection.
296-
297257
To shard a collection using a :ref:`compound hashed index
298258
<index-type-compound-hashed>`, see
299259
:ref:`sh.shardCollection-zones-compound-hashed`.
@@ -305,11 +265,6 @@ Initial Chunk Distribution with Compound Hashed Indexes
305265

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

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

315270
.. seealso::
@@ -367,7 +322,6 @@ following example uses
367322
{ last_name: "hashed" },
368323
false,
369324
{
370-
numInitialChunks: 5,
371325
collation: { locale: "simple" }
372326
}
373327
)

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

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

751751
.. include:: /includes/plan-cache-rename.rst
752752

753+
numInitialChunks Option Removed
754+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
755+
756+
Starting in MongoDB 7.2, the ``numInitialChunks`` option is removed from the
757+
:dbcommand:`shardCollection` command. The server automatically creates
758+
chunks on every shard in a cluster when using :ref:`hashed sharding
759+
<sharding-hashed>` for an empty collection.
760+
753761
Parameter Filtering
754762
~~~~~~~~~~~~~~~~~~~
755763

0 commit comments

Comments
 (0)