Skip to content

Commit 0859a69

Browse files
author
Andrew Leung
committed
added in _secondaryThrottle parameter description
1 parent a1759d5 commit 0859a69

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

source/administration/sharding.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,13 @@ This command moves the chunk that includes the shard key value "smith" to the
566566
:term:`shard` named ``mongodb-shard3.example.net``. The command will
567567
block until the migration is complete.
568568

569+
.. versionadded:: 2.2
570+
571+
:dbcommand:`moveChunk` command accepts parameter:
572+
``_secondaryThrottle``, when set to ``true``, MongoDB will ensure
573+
secondary members have replicated changes before allowing new chunk
574+
migrations to occur.
575+
569576
.. note::
570577

571578
To return a list of shards, use the :dbcommand:`listshards`

source/core/sharding-internals.txt

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ chunks. The balancer has the following thresholds:
374374
Number of Chunks Migration Threshold
375375
---------------- -------------------
376376
Greater than 80 8
377-
80-21 4
377+
21-80 4
378378
Less than 20 2
379379
================ ===================
380380

@@ -449,3 +449,50 @@ to the shard when the value of :status:`mem.mapped` exceeds the
449449
``maxSize`` setting.
450450

451451
.. seealso:: ":doc:`/administration/monitoring`."
452+
453+
.. _sharding-chunk-migration:
454+
455+
Chunk Migration
456+
~~~~~~~~~~~~~~~
457+
458+
MongoDB migrates chunks in a :term:`shard cluster` to distribute data
459+
evenly among shards. Migrations may be either:
460+
461+
- Manual. In these migrations you must specify the chunk that you want
462+
to migrate and the destination shard. Only migrate chunks manually
463+
after initiating sharding, to distribute data during bulk inserts,
464+
or if the cluster becomes uneven. See :doc:`Migrating Chunks
465+
<sharding-balancing-manual-migration>` for more details.
466+
467+
- Automatic. The balancer process handles most migrations when
468+
distribution of chunks between shards becomes uneven. See
469+
:doc:`Migration Thresholds <sharding-migration-thresholds>` for more
470+
details.
471+
472+
All chunk migrations use the following procedure:
473+
474+
#. The balancer process sends the :dbCommand:`moveChunk` command to
475+
the source shard for the chunk. In this operation the balancer
476+
passes the name of the destination shard to the source shard.
477+
478+
#. The source initaties the move with an internal
479+
:dbcommand:`moveChunk` command with the destination shard.
480+
481+
#. The destination shard begins requesting documents in the chunk, and
482+
begins receiving these chunks.
483+
484+
#. After receving the final document in the chunk, the destination
485+
shard initiates a synchronization process to ensure that all
486+
changes to the documents in the chunk on the source shard during
487+
the migration process exist on the destination shard.
488+
489+
When fully synchronized, the destination shard connects to the
490+
:term:`config database` and updates the chunk location in the
491+
cluster metadata. After completing this operation, once there are
492+
no open cursors on the chunk, the source shard starts deleting
493+
its copy of documents from the migrated chunk.
494+
495+
When the ``_secondaryThrottle`` option is set ``true`` for
496+
:dbcommand:`moveChunk` or the :term:`balancer`, MongoDB will ensure
497+
secondary members have replicated changes before allowing new chunk
498+
migrations to occur.

source/reference/command/moveChunk.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@ moveChunk
77
.. dbcommand:: moveChunk
88

99
:dbcommand:`moveChunk` is an internal command that supports the
10-
sharding functionality. Do not call directly. Use the
10+
sharding functionality. Use the
1111
:method:`sh.moveChunk()` function in the :program:`mongo` shell if
1212
you must move a chunk manually.
1313

14+
:option _secondaryThrottle: Optional. The default setting is
15+
``false``. If ``true`` this will
16+
specify that primary shard members
17+
should wait for its secondary shard
18+
members to replicate chunk data updates
19+
before allowing new chunk migrations to
20+
occur.
21+
22+
For details on chunk migrations, please
23+
see: :ref:`Sharding Internals - Chunk
24+
Migration <sharding-chunk-migration>`
25+
1426
.. admin-only

0 commit comments

Comments
 (0)