forked from mongodb/docs-cluster-to-cluster-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress.txt
112 lines (75 loc) · 2.63 KB
/
progress.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.. _c2c-api-progress:
============
``progress``
============
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
Description
-----------
Returns either an updated status of the synchronization process or an error.
Request
-------
.. code-block:: http
:copyable: false
GET /api/v1/progress
Response
--------
The ``progress`` endpoint returns either an updated status or an error.
Successful Response
~~~~~~~~~~~~~~~~~~~
The response object contains 2 top-level fields, ``success`` and
``progress``.
The ``success`` field contains the status of the ``progress`` command.
Value is ``true`` if always ``true``.
If ``mongosync`` successfully gets the status of the sync process,
all response fields are wrapped in the top-level ``progress`` object
with the following fields:
.. include:: /includes/api/tables/progress-response.rst
Error Response
~~~~~~~~~~~~~~
If ``mongosync`` encounters an error, the ``progress`` endpoint returns
the following fields:
.. include:: /includes/api/tables/progress-error-response.rst
Behavior
--------
- When ``mongosync`` is in the ``IDLE`` state, all output
fields except ``state`` and ``canCommit`` are ``null``.
- When ``mongosync`` is in the ``PAUSED`` state, the
``lagTimeSeconds`` field is ``null``.
- The endpoint does not auto-refresh. To get updated status, call the
``progress`` endpoint again.
- Calls to ``/progress`` before ``mongosync`` reaches the collection
copy phase return 0 for ``estimatedCopiedBytes`` and 1 for
``estimatedTotalBytes``.
- ``estimatedTotalBytes`` may change throughout the collection copy
phase if documents are inserted or deleted on the source cluster.
- ``estimatedCopiedBytes`` is never greater than
``estimatedTotalBytes``. Progress reaches 100% at the end of the
collection copy phase (``estimatedCopiedBytes`` =
``estimatedTotalBytes``).
- When performing a live upgrade from an earlier version to 1.8.0 or
higher, the collection copy data starts over from
``[0 bytes copied / 1 bytes total]``. After a live upgrade,
``/progress`` only reports the progress of data copied after the
upgrade completed.
.. include:: /includes/fact-restart-resume-delay.rst
Endpoint Protection
~~~~~~~~~~~~~~~~~~~
.. |endpoint| replace:: ``progress``
.. include:: /includes/fact-api-endpoint
Example
-------
The following example returns the status of the synchronization process.
Request
~~~~~~~
.. literalinclude:: /includes/api/requests/progress.sh
:language: shell
Response
~~~~~~~~
.. literalinclude:: /includes/api/responses/progress.json
:language: json
:copyable: false