@@ -133,23 +133,92 @@ Read Preference
133133connecting to the source and destination clusters. For more information,
134134see :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+
136204Destination Clusters
137205--------------------
138206
207+ .. _c2c-behavior-consistency:
208+
139209Consistency
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.
153222Retryable writes may not be retryable on the destination cluster.
154223
155224Profiling
0 commit comments