@@ -16,11 +16,12 @@ The :ref:`mongosync <c2c-mongosync>` program uses :ref:`change streams
16
16
<changeStreams>` to synchronize data between source and destination
17
17
clusters. ``mongosync`` does not access the :term:`oplog` directly,
18
18
but when a change stream returns events from the past, the events must
19
- be within the :term:` oplog` time range.
19
+ be within the `` oplog` ` time range.
20
20
21
- .. include:: /includes/fact-oplog-background.txt
22
21
23
- Estimate ``oplog`` Size Needed for Initial Sync
22
+ .. include:: /includes/fact-oplog-background
23
+
24
+ Monitor ``oplog`` Size Needed for Initial Sync
24
25
-----------------------------------------------
25
26
26
27
.. procedure::
@@ -40,55 +41,30 @@ Estimate ``oplog`` Size Needed for Initial Sync
40
41
cluster. If there are multiple shards, the smallest number is the
41
42
minimum ``oplog`` window.
42
43
43
- .. step:: Estimate Copy Rate During Synching
44
-
45
- .. _c2c-step-est-size:
46
-
47
- To gather performance data while synching, start the sync process
48
- and monitor how fast data is transferred between clusters.
49
-
50
- To start syncing, run the :ref:`/start <c2c-api-start>`
51
- command.
44
+ .. step:: Determine mongosync replication lag
52
45
53
- To get the ``copy_rate``:
54
-
55
- - run the :ref:`/progress <c2c-api-progress>` command to get
56
- ``estimatedCopiedBytes_time01``
57
- - wait a second or two
58
- - run the :ref:`/progress <c2c-api-progress>` command to get
59
- ``estimatedCopiedBytes_time02``
60
-
61
- The ``copy_rate`` is:
62
-
63
- .. code-block:: shell
64
-
65
- copy_rate = ( estimatedCopiedBytes_time02 - estimatedCopiedBytes_01) / time_between_requests
66
-
67
- .. step:: Estimate Copy Time
68
-
69
- Estimate the time needed to copy the entire collection. The
70
- estimated copy time is:
71
-
72
- .. code-block:: shell
46
+ To get the ``lagTimeSeconds`` value, run the
47
+ :ref:`/progress <c2c-api-progress>` command.
48
+ The lag time is the time in seconds between the
49
+ last event applied by ``mongosync`` and time of the current
50
+ latest event on the source cluster.
73
51
74
- estimatedCopyTime = estimatedTotalBytes / copy_rate
52
+ It is a measure of how far behind the source cluster mongosync is.
75
53
76
54
.. step:: Validate ``oplog`` Size
77
55
78
- If the estimated time is larger than the minimum oplog window you
79
- must cancel synchronization. Before restarting, make one of the
80
- following changes:
56
+ If the lag time approaches the minimum ``oplog`` window, you
57
+ should make one of the following changes:
81
58
82
- - Increase the oplog window. Use :dbcommand:`replSetResizeOplog`
83
- to set ``minRetentionHours`` greater than the estimated copy
84
- time .
59
+ - Increase the `` oplog`` window. Use :dbcommand:`replSetResizeOplog`
60
+ to set ``minRetentionHours`` greater than the current ``oplog``
61
+ window .
85
62
- Scale up the ``mongosync`` instance. Add cpu or memory to scale
86
63
up the ``mongosync`` node so that it has a higher copy rate.
87
64
88
65
.. note::
89
66
90
- The copy rate may vary during synchronization. To monitor progress,
91
- repeat the :ref:`steps to estimate the copy rate
92
- <c2c-step-est-size>` and verify that the copy rate stays about the
93
- same.
67
+ The ``oplog`` window and rate of change of replication lag may vary during
68
+ synchronization. Repeat these steps during a migration to monitor the
69
+ progress.
94
70
0 commit comments