@@ -138,6 +138,8 @@ If you shard a populated collection using a hashed shard key:
138
138
- After the initial chunk creation, the balancer moves ranges of the
139
139
initial chunk when it needs to balance data.
140
140
141
+ .. _shard-empty-collection:
142
+
141
143
Shard an Empty Collection
142
144
~~~~~~~~~~~~~~~~~~~~~~~~~
143
145
@@ -147,20 +149,19 @@ Sharding Empty Collection on Single Field Hashed Shard Key
147
149
- With no :ref:`zones and zone ranges <zones-sharding>` specified
148
150
for the empty or non-existing collection:
149
151
150
- - The sharding operation creates empty chunks to cover the entire
151
- range of the shard key values and performs an initial chunk
152
- distribution. By default, the operation creates 2 chunks per shard
153
- and migrates across the cluster. You can use ``numInitialChunks``
154
- option to specify a different number of initial chunks. This
155
- initial creation and distribution of chunks allows for faster
156
- setup of sharding.
152
+ - The sharding operation creates an empty chunk to cover the entire
153
+ range of the shard key values. Starting in version 7.2, the
154
+ operation creates 1 chunk per shard by default and migrates
155
+ across the cluster. You can use ``numInitialChunks`` option to
156
+ specify a different number of initial chunks and cause an initial
157
+ chunk distribution. This initial creation and distribution of
158
+ chunks allows for faster setup of sharding.
157
159
158
160
- After the initial distribution, the balancer manages the chunk
159
161
distribution going forward.
160
162
161
163
- With zones and zone ranges specified
162
- for the empty or a non-existing collection (Available starting in
163
- MongoDB 4.0.3):
164
+ for the empty or a non-existing collection:
164
165
165
166
- The sharding operation creates empty chunks for the defined zone
166
167
ranges as well as any additional chunks to cover the entire range
@@ -173,19 +174,20 @@ Sharding Empty Collection on Single Field Hashed Shard Key
173
174
174
175
Sharding Empty Collection on Compound Hashed Shard Key with Hashed Field Prefix
175
176
If the compound hashed shard key has the hashed field as the prefix
176
- (i.e. the hashed field is the first field in the shard key):
177
+ (the hashed field is the first field in the shard key):
177
178
178
179
- With no zones and zone ranges specified
179
180
for the empty or non-existing collection:
180
181
181
182
- The sharding operation creates empty chunks to cover the entire
182
183
range of the shard key values and performs an initial chunk
183
184
distribution. The value of all non-hashed fields is :bsontype:`MinKey` at
184
- each split point. By default, the operation creates 2 chunks per
185
- shard and migrates across the cluster. You can use
186
- ``numInitialChunks`` option to specify a different number of
187
- initial chunks. This initial creation and distribution of chunks
188
- allows for faster setup of sharding.
185
+ each split point. Starting in version 7.2, the operation creates
186
+ 1 chunk per shard by default and migrates across the cluster. You
187
+ can use ``numInitialChunks`` option to specify a different number
188
+ of initial chunks and cause an initial chunk distribution. This
189
+ initial creation and distribution of chunks allows for faster
190
+ setup of sharding.
189
191
190
192
- After the initial distribution, the balancer manages the chunk
191
193
distribution going forward.
0 commit comments