Description
Returns either an updated status of the synchronization process or an error.
Request
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 the command succeeds and false if the command fails.
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:
Field | Type | Description | ||||
|---|---|---|---|---|---|---|
| string | The current state of | ||||
| boolean | If
If you set buildIndexes to Changed in version 1.21. :
| ||||
| boolean | If Index validation continues until the commit is complete. | ||||
| object | Shows real-time progress of index builds on the destination cluster if you set IMPORTANT: Because | ||||
| integer | The number of indexes that | ||||
| integer | The total number of indexes that | ||||
| integer | The number of collections that | ||||
| integer | The total number of collections that | ||||
| string | Provides extra information on the synchronization progress. Possible
| ||||
| object | Reports synchronization lag broken down by component. The New in version 1.21. : | ||||
| integer | Time difference in seconds between the latest event timestamp that New in version 1.21. : | ||||
| integer | CRUD component of the synchronization lag in seconds. This field is New in version 1.21. : | ||||
| integer | DDL component of the synchronization lag in seconds. This field is New in version 1.21. : | ||||
| integer | Deprecated in mongosync 1.21. Use Time difference in seconds between the latest event timestamp that
Due to constant no-ops on the source cluster, the time difference is often a few seconds above zero, even if there are no real writes on the source cluster. The time difference becomes zero when As of version 1.9, | ||||
| integer | The approximate number of change events this instance of This value may not be an accurate representation of the total number of events because it is not persisted and it omits certain events from the count. | ||||
| object | Estimates the total amount of data being copied from collections and the amount that has already been copied to the destination cluster | ||||
| integer | Estimated total number of bytes to be copied globally by all
| ||||
| integer | Estimated number of bytes copied to the destination cluster by this To calculate total estimated progress as a percentage:
Both values are best-effort estimates and may not accurately reflect actual migration progress. | ||||
| integer | Provides the last-known ping latency, in milliseconds, from New in version 1.17. : | ||||
| object | Describes the mapping direction for the synchronization, namely the source and destination clusters. | ||||
| string | Source cluster. Returned in the form | ||||
| string | Destination cluster. Returned in the form | ||||
| string | Shows estimate of the oplog time available on the source cluster. Possible values include a duration (for example,
IMPORTANT: If you increase the oplog size on the source cluster,
New in version 1.19. : | ||||
| integer | Estimated time in seconds remaining in the Change Event Application (CEA) phase, based on how much
New in version 1.14. : | ||||
| string | Identifier string for the New in version 1.3. : | ||||
| string | Identifier string for the coordinator instance.
New in version 1.3. : | ||||
| integer | Provides the last-known ping latency, in milliseconds, from New in version 1.17. : | ||||
| document | Provides information on the phase and progress of verification checks performed by the embedded verifier. New in version 1.9. : | ||||
| document | Provides information on the phase and progress of verification checks running on the source cluster. New in version 1.9. : | ||||
| integer | Estimated number of documents on the source cluster. New in version 1.9. : | ||||
| integer | Number of documents hashed by the verifier on the source cluster. New in version 1.9. : | ||||
| integer | Time in seconds after the last verification check was performed on the source cluster. New in version 1.9. : | ||||
| string | Current phase of the verification process on the source cluster. This can be one of three values:
If the verifier needs to re-scan a collection, the verifier can go back to the New in version 1.9. : | ||||
| integer | Number of collections scanned by the embedded verifier on the source cluster. New in version 1.9. : | ||||
| integer | Number of collections on the source cluster to include in verification checks. | ||||
| document | Provides information on the phase and progress of verification checks running on the destination cluster. New in version 1.9. : | ||||
| integer | Estimated number of documents on the destination cluster. New in version 1.9. : | ||||
| integer | Number of documents hashed by the verifier on the destination cluster. New in version 1.9. : | ||||
| integer | Time in seconds since the last verification check performed on the destination cluster. New in version 1.9. : | ||||
| string | Current phase of the verification process on the destination cluster. This can be one of three values:
If the verifier needs to re-scan a collection, the verifier can go back to the New in version 1.9. : | ||||
| integer | Number of collections scanned by the embedded verifier on the destination cluster. New in version 1.9. : | ||||
| integer | Number of collections on the destination cluster to include in verification checks. New in version 1.9. : | ||||
| array of strings | Warning messages that If the estimated oplog time remaining is very low, For more details, see oplog Sizing. If New in version 1.19. : |
Error Response
If mongosync encounters an error, the progress endpoint returns the following fields:
Field | Type | Description |
|---|---|---|
| boolean | Status of the |
| string | Type of error. |
| string | Detailed description of the error. |
Behavior
When
mongosyncis in theIDLEstate, all output fields exceptstateandcanCommitarenull.When
mongosyncis in thePAUSEDstate, thelagobject isnulland the deprecatedlagTimeSecondsfield isnull.When
mongosyncis in theINITIALIZINGstate,mongosyncrejects/startrequests. Once initialization completes,mongosyncreturnsIDLEand accepts/startrequests.If
mongosyncresumes or restarts after a crash, once initialization completes, the/progressresponse returns thestatebefore the crash.The endpoint does not auto-refresh. To get updated status, call the
progressendpoint again.Calls to
/progressbeforemongosyncreaches the collection copy phase return 0 forestimatedCopiedBytesand 1 forestimatedTotalBytes.During collection copy,
estimatedTotalBytesonly changes ifestimatedCopiedBytesexceeds it. In that case,mongosyncraisesestimatedTotalBytesto equalestimatedCopiedBytes.At the end of collection copy,
estimatedTotalBytesequalsestimatedCopiedBytes.mongosyncuses the total bytes copied as the source of truth. Both values are best-effort estimates.
Endpoint Protection
mongosync does not protect the progress endpoint. However, by default the API binds to localhost only and does not accept calls from other sources. Additionally, the progress call does not expose connection credentials or user data.
Example
The following example returns the status of the synchronization process.
Request
curl localhost:27182/api/v1/progress -XGET
Response
{ "progress": { "state":"RUNNING", "canCommit":true, "canWrite":false, "info":"change event application", "lag": { "overallLagSeconds": 0, "crudLagSeconds": 0, "ddlLagSeconds": null }, "lagTimeSeconds":0, "collectionCopy": { "estimatedTotalBytes":694, "estimatedCopiedBytes":694 }, "directionMapping": { "Source":"cluster0: localhost:27017", "Destination":"cluster1: localhost:27018" }, "source": { "pingLatencyMs":250 }, "destination": { "pingLatencyMs":-1 }, "verification": { "source": { "estimatedDocumentCount": 42, "hashedDocumentCount": 42, "lagTimeSeconds": 2, "totalCollectionCount": 42, "scannedCollectionCount": 10, "phase": "stream hashing" }, "destination": { "estimatedDocumentCount": 42, "hashedDocumentCount": 42, "lagTimeSeconds": 2, "totalCollectionCount": 42, "scannedCollectionCount": 10, "phase": "stream hashing" } } }, "success": true }