Skip to content

Commit 0a16741

Browse files
jason-price-mongodbjason-price-mongodb
andauthored
DOCSP-30176-resharding-update (#4198)
* 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 3824365 commit 0a16741

7 files changed

+51
-45
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 & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,18 +1113,10 @@ Output Fields
11131113

11141114
.. data:: currentOp.remainingOperationTimeEstimatedSecs
11151115

1116-
The estimated time remaining in seconds for the current
1117-
:ref:`resharding operation <sharding-resharding>`. The time is set to
1118-
-1 when a new resharding operation starts.
1119-
1120-
Only present on a :ref:`recipient shard <resharding-process-details>`
1121-
when a resharding operation is taking place.
1116+
.. include:: /includes/remainingOperationTimeEstimatedSecs-details.rst
11221117

11231118
.. versionadded:: 5.0
11241119

1125-
Starting in MongoDB 6.1, this metric is also available on the
1126-
coordinator during resharding.
1127-
11281120
.. data:: currentOp.allShardsLowestRemainingOperationTimeEstimatedSecs
11291121

11301122
Calculated across all shards, the lowest estimate of the number of

source/reference/command/reshardCollection.txt

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

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

133121
Initialization Phase
134122
~~~~~~~~~~~~~~~~~~~~
135123

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

141127
Index Phase
142128
~~~~~~~~~~~

source/reference/method/sh.reshardCollection.txt

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

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

148136
Initialization Phase
149137
~~~~~~~~~~~~~~~~~~~~
150138

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

156142
Index Phase
157143
~~~~~~~~~~~

0 commit comments

Comments
 (0)