Skip to content

Commit 86ced62

Browse files
authored
DOCSP-41999-mongosync-disaster-recovery (#377) (#414)
* DOCSP-41999-mongosync-dr * add redirect + build errors * build error * rebase * add 1.8 to redirects * remove output.txt * MvK feedback * * * * * move considerations section * typo * MvK feedback (2/2) * more external review * faq edits * * * MvK feedback (2/2) * more feedback * * * add table * * * formatting * * * * * * * wording * * * title * * * nit * change uptodate to consisten
1 parent 5b7607b commit 86ced62

File tree

6 files changed

+100
-210
lines changed

6 files changed

+100
-210
lines changed

config/redirects

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
define: prefix docs/cluster-to-cluster-sync
22
define: base https://www.mongodb.com/docs/cluster-to-cluster-sync
3-
define: versions v0.9 master
3+
define: versions v0.9 v1.7 v1.8 master
44

55
# raw: <source file> -> ${base}/<destination>
66

@@ -51,3 +51,6 @@ raw: ${prefix}/current/installation/install-on-windows/ -> ${base}/current/
5151
[v0.9]: ${prefix}/${version}/release-notes/1.0 -> ${base}/${version}/release-notes/
5252
[v0.9]: ${prefix}/${version}/release-notes/1.1 -> ${base}/${version}/release-notes/
5353
[v0.9]: ${prefix}/${version}/release-notes/1.2 -> ${base}/${version}/release-notes/
54+
55+
# DOCSP-41999 redirect disaster recovery to mongosync behavior page
56+
[*]: ${prefix}/${version}/reference/disaster-recovery -> ${base}/${version}/about-mongosync/#considerations-for-continuous-sync

source/faq.txt

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,18 @@ Support.
2020
Can I perform reads or writes to my destination cluster while ``mongosync`` is syncing?
2121
---------------------------------------------------------------------------------------
2222

23-
You can perform reads during synchronization if ``canCommit`` is ``true``.
24-
However, the data that you read is
25-
:term:`eventually consistent <eventual consistency>`, meaning that you might not
26-
always read the latest writes.
23+
You can perform reads during synchronization at any time. However, the data
24+
that you read is :term:`eventually consistent <eventual consistency>`. For
25+
consistent reads, wait for the migration to commit. To learn more, see
26+
:ref:`mongosync-considerations`.
2727

28-
During an ongoing sync, you can write to any non-synced namespaces in the
29-
destination cluster as long as the source cluster doesn’t include a namespace
30-
with the same name. If you write to a synced namespace before issuing a
31-
:ref:`commit <c2c-api-commit>` and while ``canWrite`` is ``false``, the behavior
32-
is undefined. To avoid this undefined behavior, you can enable
33-
:ref:`write blocking <c2c-dr-write-blocking>`.
28+
If you write to a synced namespace before issuing a :ref:`commit
29+
<c2c-api-commit>` and while ``canWrite`` is ``false``, the behavior is
30+
undefined. To ensure that you don't write to any synced namespaces, denable
31+
:ref:`write blocking <c2c-write-blocking>`.
3432

35-
To check the value of ``canCommit`` or ``canWrite``, call the :ref:`progress
36-
<c2c-api-progress>` API endpoint.
33+
To check the value of ``canWrite``, call the :ref:`progress <c2c-api-progress>`
34+
API endpoint.
3735

3836
Can ``mongosync`` run on its own hardware?
3937
------------------------------------------
@@ -86,10 +84,10 @@ Which security and authentication options are supported?
8684
authentication options, see :ref:`authentication`.
8785

8886

89-
Can I configure ``mongosync`` for high availability?
90-
----------------------------------------------------
87+
Does ``mongosync`` automatically restart on error?
88+
--------------------------------------------------
9189

92-
There is no automatic failover built into ``mongosync``. However you
90+
``mongosync`` does not automatically restart on error. However, you
9391
can write a script or use your operating system's process managers,
9492
``systemd`` for example, to restart the ``mongosync`` process.
9593

source/reference.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ Reference
2222
:ref:`c2c-oplog-sizing`
2323
Increase the size of the oplog on the source cluster for large data
2424
sets.
25-
26-
:ref:`c2c-failure-recovery`
27-
Prepare for disaster recovery using :ref:`connections
28-
<c2c-connecting>` between clusters.
2925

3026
:ref:`c2c-limitations`
3127
Limitations of ``mongosync``.
@@ -57,7 +53,6 @@ Reference
5753
mongosync States </reference/mongosync-states>
5854
Filtered Sync </reference/collection-level-filtering>
5955
oplog Sizing </reference/oplog-sizing>
60-
Disaster Recovery </reference/disaster-recovery>
6156
Limitations </reference/limitations>
6257
Logging </reference/logging>
6358
User Permissions </reference/permissions>

source/reference/api/commit.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,30 +153,29 @@ characteristics that ``mongosync`` alters during the synchronization process.
153153

154154
* - Collection Characteristic
155155
- Impact of ``commit``
156-
* - :ref:`Unique Indexes <c2c-dr-unique>`
156+
* - Unique Indexes
157157
- ``commit`` resets unique indexes that ``mongosync`` replicated as
158158
non-unique on the destination cluster.
159159

160-
* - :ref:`TTL Indexes <c2c-dr-ttl>`
160+
* - TTL Indexes
161161
- ``commit`` resets ``expireAfterSeconds`` which ``mongosync`` set
162162
to the value of ``MAX_INT`` on the destination cluster.
163163

164-
* - :ref:`Hidden Indexes <c2c-dr-hidden>`
164+
* - Hidden Indexes
165165
- ``commit`` resets hidden indexes that ``mongosync``
166166
replicated as non-hidden on the destination cluster.
167167

168-
* - :ref:`Write Blocking <c2c-dr-write-blocking>`
168+
* - Write Blocking
169169
- If you enable write-blocking, ``mongosync`` blocks writes:
170170

171171
- On the destination cluster during sync.
172172
- On the source cluster when ``commit`` is received.
173173

174174
.. seealso::
175175

176-
- :ref:`c2c-failure-recovery`
177-
- :ref:`c2c-write-blocking`
176+
:ref:`c2c-write-blocking`
178177

179-
* - :ref:`Capped Collections <c2c-dr-capped-collections>`
178+
* - Capped Collections
180179
- ``commit`` resets the required maximum size of capped collections
181180
which ``mongosync`` set to the maximum allowable size on the
182181
destination cluster.

source/reference/disaster-recovery.txt

Lines changed: 0 additions & 174 deletions
This file was deleted.

source/reference/mongosync/mongosync-behavior.txt

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,92 @@ Read Preference
133133
connecting to the source and destination clusters. For more information,
134134
see :ref:`connections-read-preference`.
135135

136+
.. _mongosync-considerations:
137+
138+
Considerations for Continuous Sync
139+
----------------------------------
140+
141+
For any continuous synchronization use cases with ``mongosync``, ensure that
142+
``mongosync`` commits before cutting over from the source to the
143+
destination.
144+
145+
If the source cluster shuts down before ``mongosync`` can commit, such as in
146+
a disaster scenario, the destination cluster might not have a consistent
147+
snapshot of the source data. To learn more, see :ref:`c2c-behavior-consistency`.
148+
149+
.. note::
150+
151+
After commit, you can't resume continuous sync between two clusters since
152+
``mongosync`` can only sync into empty destination clusters. If you need to
153+
use the same two clusters after cutover, you can call the
154+
:ref:`c2c-api-reverse` endpoint to keep the clusters in sync.
155+
Otherwise, start a new continuous sync operation by using a new empty
156+
destination cluster.
157+
158+
Sharded Clusters
159+
~~~~~~~~~~~~~~~~
160+
161+
When running continuous sync with sharded clusters, you must stop
162+
:ref:`balancers <sharding-balancing>` on both the source and the destination
163+
for the lifetime of the sync until commit.
164+
165+
Temporary Changes to Collection Characteristics
166+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
167+
168+
``mongosync`` temporarily alters the following collection characteristics during
169+
synchronization. The original values are restored during the commit process.
170+
171+
.. list-table::
172+
:header-rows: 1
173+
174+
* - Change
175+
- Description
176+
177+
* - Unique Indexes
178+
- Unique indexes on the source cluster are synced as non-unique indexes
179+
on the destination cluster.
180+
181+
* - TTL Indexes
182+
- Synchronization sets ``expireAfterSeconds`` to the value of ``MAX_INT``
183+
on the destination cluster.
184+
185+
* - Hidden Indexes
186+
- Synchronization replicates hidden indexes as non-hidden.
187+
188+
* - Write Blocking
189+
- If you enable write-blocking, ``mongosync`` blocks writes:
190+
191+
- On the destination cluster during sync.
192+
- On the source cluster when ``commit`` is received.
193+
194+
To learn more, see :ref:`c2c-write-blocking`.
195+
196+
* - Capped Collections
197+
- Synchronization sets capped collections to the maximum allowable
198+
size.
199+
200+
* - Dummy Indexes
201+
- In some cases, synchronization may create dummy indexes on the
202+
destination to support writes on sharded or collated collections.
203+
136204
Destination Clusters
137205
--------------------
138206

207+
.. _c2c-behavior-consistency:
208+
139209
Consistency
140210
~~~~~~~~~~~
141211

142212
``mongosync`` supports :term:`eventual consistency` on the destination
143-
cluster. Read Consistency is not guaranteed on the destination cluster,
144-
the source and destination clusters may differ at a given point in
145-
time. However, if new writes are halted on the source cluster, the
146-
source and destination clusters will eventually hold the same data.
213+
cluster. Read consistency is not guaranteed on the destination cluster until
214+
commit. Before committing, the source and destination clusters may differ at a
215+
given point in time. To learn more, see :ref:`mongosync-considerations`.
147216

148-
Individual writes may be reordered or combined as they are relayed from
149-
source to destination. For a given document, the total number of writes
150-
may differ between source and destination.
217+
While ``mongosync`` is syncing, ``mongosync`` may reorder or combine writes
218+
as it relays them from source to destination. For a given document, the total
219+
number of writes may differ between source and destination.
151220

152-
Transactions may appear non-atomically on the destination cluster.
221+
Transactions might not appear atomically on the destination cluster.
153222
Retryable writes may not be retryable on the destination cluster.
154223

155224
Profiling

0 commit comments

Comments
 (0)