Skip to content

Commit 65002b9

Browse files
kennethdyerrohshar
andauthored
DOCS-15946 Documents buildIndexes option (#120)
* DOCS-15946 Documents buildIndexes option * Adjusts text * Fixes per Jason Price * Fixes per Rohan Sharan * Forces build * Adjusts text * Fixes per Rohan Sharan * Update source/reference/api/start.txt Co-authored-by: Rohan Sharan <[email protected]> * Update source/reference/api/start.txt Co-authored-by: Rohan Sharan <[email protected]> * Fixes per Rohan Sharan * Fixes per Rohan Sharan * Update source/reference/api/start.txt Co-authored-by: Rohan Sharan <[email protected]> * Fixes per Rohan Sharan * Fixes per Rohan Sharan * Fixes per Rohan Sharan --------- Co-authored-by: Rohan Sharan <[email protected]>
1 parent 4667b33 commit 65002b9

File tree

2 files changed

+63
-2
lines changed

2 files changed

+63
-2
lines changed

source/reference/api/start.txt

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,38 @@ Request Body Parameters
9191
- Required
9292
- Name of the destination cluster.
9393

94+
* - ``buildIndexes``
95+
- boolean
96+
- Optional
97+
- Configures index builds during sync.
98+
99+
Supported Options:
100+
101+
- ``beforeDataCopy`` (the default) causes ``mongosync`` to build indexes
102+
on the destination cluster. These include both existing indexes and
103+
any indexes created during migration on the source cluster.
104+
105+
- ``never`` causes ``mongosync`` to skip building unnecessary indexes
106+
during sync. This can improve migration performance, especially with
107+
index heavy workloads.
108+
109+
.. warning::
110+
111+
Do **not** manually build indexes while ``mongosync`` is
112+
performing a migration. Wait until the migration is fully
113+
committed.
114+
115+
For more information on the indexes it does build, see
116+
:ref:`c2c-required-indexes`.
117+
118+
``/start`` returns an error when ``buildIndexes`` is set to ``never``
119+
and ``reversible`` is set to ``true``.
120+
121+
If you call ``/start`` without specifying the ``buildIndexes`` option,
122+
``mongosync`` builds indexes on the destination cluster.
123+
124+
.. versionadded:: 1.3.0
125+
94126
* - ``enableUserWriteBlocking``
95127
- boolean
96128
- Optional
@@ -136,6 +168,8 @@ Request Body Parameters
136168
* Sync from a replica set to a sharded cluster
137169

138170
* Sync sharded clusters that have different numbers of shards
171+
172+
* Reversible sync when ``buildIndexes`` is set to ``never``.
139173

140174
For more information, see the :ref:`reverse <c2c-api-reverse>` endpoint.
141175

@@ -144,7 +178,7 @@ Request Body Parameters
144178
* - ``sharding``
145179
- document
146180
- Optional
147-
- Configure sync between a replica set and sharded cluster.
181+
- Configures sync between a replica set and sharded cluster.
148182
Sync from a replica set to a sharded cluster requires this
149183
option.
150184

@@ -406,4 +440,22 @@ To check whether it is safe to rename collections, call the
406440
Renaming the collection from this point on does not block
407441
its sharding on the destination cluster, even in the event of a crash.
408442

443+
.. _c2c-required-indexes:
444+
445+
Required Indexes
446+
~~~~~~~~~~~~~~~~
447+
448+
When you call ``/start`` with the ``buildIndexes`` option set to ``never``,
449+
``mongosync`` skips building unnecessary indexes.
450+
451+
Indexes that are always built include:
452+
453+
* ``mongosync`` builds an index on the ``_id`` field of every
454+
collection it copies.
455+
456+
* Starting in MongoDB 6.0, ``mongosync`` builds dummy indexes that support
457+
the shard key for each sharded collection, which are removed after commit.
458+
When ``buildIndexes`` is set to ``never``, ``mongosync`` retains this
459+
index after commit.
409460

461+

source/release-notes/1.3.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,13 @@ Capped Collections
2222

2323
Starting in 1.3.0, {+c2c-product-name+} supports :ref:`capped
2424
collections <manual-capped-collection>`. For more information, see
25-
:ref:`c2c-capped-collections`.
25+
:ref:`c2c-capped-collections`.
26+
27+
Disable Index Builds
28+
--------------------
29+
30+
Starting in 1.3.0, {+c2c-product-name+} supports disabling non-essential
31+
index builds on the destination cluster. This can improve migration
32+
performance, especially with index heavy workloads.
33+
34+
For more information, see :ref:`c2c-api-start`.

0 commit comments

Comments
 (0)