Skip to content

Commit a1bebfa

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-30176-resharding-update (#4198) (#4333)
* DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update * DOCSP-30176-resharding-update --------- Co-authored-by: jason-price-mongodb <[email protected]>
1 parent e73d93f commit a1bebfa

File tree

7 files changed

+51
-42
lines changed

7 files changed

+51
-42
lines changed

source/core/sharding-reshard-a-collection.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ Limitations
180180
Resharding Process
181181
------------------
182182

183+
.. include:: /includes/reshard-collection-introduction.rst
184+
183185
.. include:: /includes/steps/reshard-a-collection.rst
184186

185187
Behavior
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
``remainingOperationTimeEstimatedSecs``: estimated time remaining in
2+
seconds for the current :ref:`resharding operation
3+
<sharding-resharding>`. It is returned as ``-1`` when a new resharding
4+
operation starts.
5+
6+
Starting in:
7+
8+
- MongoDB 5.0, but before MongoDB 6.1,
9+
``remainingOperationTimeEstimatedSecs`` is only available on a
10+
:ref:`recipient shard <resharding-process-details>` during a
11+
resharding operation.
12+
- MongoDB 6.1, ``remainingOperationTimeEstimatedSecs`` is also available
13+
on the coordinator during a resharding operation.
14+
15+
The resharding operation performs these phases in order:
16+
17+
#. The clone phase duplicates the current collection data.
18+
#. The catch-up phase applies any pending write operations to the
19+
resharded collection.
20+
21+
``remainingOperationTimeEstimatedSecs`` is set to a pessimistic time
22+
estimate:
23+
24+
- The catch-up phase time estimate is set to the clone phase time, which
25+
is a relatively long time.
26+
- In practice, if there are only a few pending write operations, the
27+
actual catch-up phase time is relatively short.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
In a collection resharding operation, a shard can be a:
2+
3+
- **donor**, which currently stores :term:`chunks <chunk>` for the
4+
sharded collection.
5+
- **recipient**, which stores new chunks for the sharded collection
6+
based on the :term:`shard keys <shard key>` and :ref:`zones
7+
<zone-sharding>`.
8+
9+
A shard can be donor and a recipient at the same time. The set of donor
10+
shards is identical to the recipient shards, unless you use zones.
11+
12+
The config server primary is always the resharding coordinator and
13+
starts each phase of the resharding operation.

source/includes/steps-reshard-a-collection.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ content: |
1616
1717
MongoDB sets the max number of seconds to block writes to two seconds
1818
and begins the resharding operation.
19+
1920
---
2021
title: Monitor the resharding operation.
2122
level: 4
@@ -46,8 +47,7 @@ content: |
4647
4748
- ``totalOperationTimeElapsedSecs``: elapsed operation time in
4849
seconds
49-
- ``remainingOperationTimeEstimatedSecs``: estimate of the remaining
50-
time to complete the resharding operation
50+
- .. include:: /includes/remainingOperationTimeEstimatedSecs-details.rst
5151
5252
.. code-block:: javascript
5353

source/reference/command/currentOp.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,12 +1094,7 @@ Output Fields
10941094

10951095
.. data:: currentOp.remainingOperationTimeEstimated
10961096

1097-
The estimated time remaining in seconds for the current
1098-
:ref:`resharding operation <sharding-resharding>`. The time is set to
1099-
-1 when a new resharding operation starts.
1100-
1101-
Only present on a :ref:`recipient shard <resharding-process-details>`
1102-
when a resharding operation is taking place.
1097+
.. include:: /includes/remainingOperationTimeEstimatedSecs-details.rst
11031098

11041099
.. versionadded:: 5.0
11051100

source/reference/command/reshardCollection.txt

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,13 @@ The :binary:`~bin.mongosh` provides a wrapper method
117117
Resharding Process
118118
------------------
119119

120-
During the resharding process, there are two roles a shard may play:
121-
122-
- **Donors** are shards which currently own chunks of the sharded
123-
collection.
124-
- **Recipients** are shards which would own chunks of the sharded
125-
collection according to the new shard key and zones.
126-
127-
A shard may play both the role of a donor and a recipient concurrently.
128-
Unless zones are being used, the set of donor shards is the same as the
129-
set of recipient shards.
130-
131-
The config server primary is always chosen as the resharding
132-
coordinator, responsible for initiating each phase of the process.
120+
.. include:: /includes/reshard-collection-introduction.rst
133121

134122
Initialization Phase
135123
~~~~~~~~~~~~~~~~~~~~
136124

137-
During the initialization phase:
138-
139-
- The balancer determines the new data distribution for the sharded
140-
collection.
125+
During the initialization phase, the resharding coordinator determines
126+
the new data distribution for the sharded collection.
141127

142128
Index Phase
143129
~~~~~~~~~~~

source/reference/method/sh.reshardCollection.txt

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,13 @@ The ``options`` argument supports the following options:
132132
Resharding Process
133133
------------------
134134

135-
During the resharding process, there are two roles a shard may play:
136-
137-
- **Donors** are shards which currently own chunks of the sharded
138-
collection.
139-
- **Recipients** are shards which would own chunks of the sharded
140-
collection according to the new shard key and zones.
141-
142-
A shard may play both the role of a donor and a recipient concurrently.
143-
Unless zones are being used, the set of donor shards is the same as the
144-
set of recipient shards.
145-
146-
The config server primary is always chosen as the resharding
147-
coordinator, responsible for initiating each phase of the process.
135+
.. include:: /includes/reshard-collection-introduction.rst
148136

149137
Initialization Phase
150138
~~~~~~~~~~~~~~~~~~~~
151139

152-
During the initialization phase:
153-
154-
- The balancer determines the new data distribution for the sharded
155-
collection.
140+
During the initialization phase, the resharding coordinator determines
141+
the new data distribution for the sharded collection.
156142

157143
Index Phase
158144
~~~~~~~~~~~

0 commit comments

Comments
 (0)