@@ -36,12 +36,29 @@ Steps
36
36
Ensure that the ``mongosync`` process status indicates the
37
37
following values:
38
38
39
+ - ``canCommit`` is ``true``.
40
+
39
41
- ``lagTimeSeconds`` is small (near ``0``).
40
42
41
43
If ``lagTimeSeconds`` isn't close to ``0`` when the cutover
42
44
starts, cutover might take a long time.
43
45
44
- - ``canCommit`` is ``true``.
46
+ The following example returns the status of the synchronization process.
47
+
48
+ Request
49
+ ~~~~~~~
50
+
51
+ .. literalinclude:: /includes/api/requests/progress.sh
52
+ :language: shell
53
+
54
+ Response
55
+ ~~~~~~~~
56
+
57
+ .. literalinclude:: /includes/api/responses/progress.json
58
+ :language: json
59
+ :copyable: false
60
+ :emphasize-lines: 5, 8
61
+
45
62
46
63
.. step:: Stop any write operations to the synced collections on the source.
47
64
50
67
the entire source cluster during the commit (step 4) for you.
51
68
- If you didn't start ``mongosync`` with
52
69
``enableUserWriteBlocking``, ensure that writes are disabled.
53
- For example, run the ``setUserWriteBlockMode`` command on the
54
- source cluster.
70
+ For example, run the :dbcommand:`setUserWriteBlockMode` command on the
71
+ source cluster:
72
+
73
+ .. code-block:: javascript
74
+
75
+ db.adminCommand( {
76
+ setUserWriteBlockMode: 1,
77
+ global: true
78
+ } )
79
+
55
80
- If ``mongosync`` uses filtered sync, it's not necessary to
56
81
disable writes to the entire source cluster. But you must ensure
57
82
that write operations are stopped for the collections included
@@ -63,19 +88,67 @@ Steps
63
88
migration, you must issue a commit request for each ``mongosync``
64
89
instance.
65
90
91
+ Request
92
+ ~~~~~~~~
93
+
94
+ .. literalinclude:: /includes/api/requests/commit.sh
95
+ :language: shell
96
+
97
+ Response
98
+ ~~~~~~~~
99
+
100
+ .. literalinclude:: /includes/api/responses/success.json
101
+ :language: json
102
+ :copyable: false
103
+
66
104
.. note::
67
105
68
- Ensure that the ``mongosync`` process response for the
69
- ``commit`` request indicates that the ``mongosync`` state is
70
- ``COMMITTING`` or ``COMMITTED``, which is the correct
71
- ``mongosync`` state when you send a ``commit`` request.
106
+ After you submit a ``commit`` request, call the ``progress`` endpoint
107
+ to ensure that the ``mongosync`` state is ``COMMITTING`` or
108
+ ``COMMITTED``.
72
109
73
110
.. step:: Wait until you can perform writes on the destination cluster.
74
111
75
112
Call the ``progress`` endpoint to determine if ``canWrite`` is
76
113
``true``. If ``canWrite`` is ``false``, wait until ``progress``
77
114
shows ``canWrite`` is ``true``.
78
115
116
+ Request
117
+ ~~~~~~~
118
+
119
+ .. literalinclude:: /includes/api/requests/progress.sh
120
+ :language: shell
121
+
122
+ Response
123
+ ~~~~~~~~
124
+
125
+ .. code-block:: json
126
+ :emphasize-lines: 6
127
+ :copyable: false
128
+
129
+ {
130
+ "progress":
131
+ {
132
+ "state":"COMMITTED",
133
+ "canCommit":true,
134
+ "canWrite":true,
135
+ "info":"change event application",
136
+ "lagTimeSeconds":0,
137
+ "collectionCopy":
138
+ {
139
+ "estimatedTotalBytes":694,
140
+ "estimatedCopiedBytes":694
141
+ },
142
+ "directionMapping":
143
+ {
144
+ "Source":"cluster0: localhost:27017",
145
+ "Destination":"cluster1: localhost:27018"
146
+ }
147
+ },
148
+ "success": true
149
+ }
150
+
151
+
79
152
.. step:: Verify data transfer.
80
153
81
154
Verify the successful sync of data from the source to the
@@ -102,6 +175,43 @@ Steps
102
175
``mongosync`` state is ``COMMITTED``, the cutover process is
103
176
complete.
104
177
178
+ Request
179
+ ~~~~~~~
180
+
181
+ .. literalinclude:: /includes/api/requests/progress.sh
182
+ :language: shell
183
+
184
+ Response
185
+ ~~~~~~~~
186
+
187
+ .. code-block:: json
188
+ :emphasize-lines: 4
189
+ :copyable: false
190
+
191
+ {
192
+ "progress":
193
+ {
194
+ "state":"COMMITTED",
195
+ "canCommit":true,
196
+ "canWrite":false,
197
+ "info":"change event application",
198
+ "lagTimeSeconds":0,
199
+ "collectionCopy":
200
+ {
201
+ "estimatedTotalBytes":694,
202
+ "estimatedCopiedBytes":694
203
+ },
204
+ "directionMapping":
205
+ {
206
+ "Source":"cluster0: localhost:27017",
207
+ "Destination":"cluster1: localhost:27018"
208
+ }
209
+ },
210
+ "success": true
211
+ }
212
+
213
+
214
+
105
215
Learn More
106
216
----------
107
217
0 commit comments