Docs Menu
Docs Home
/
MongoDB Cluster-to-Cluster Sync
/

mongosync States

On this page

  • View the Current State
  • State Descriptions

mongosync enters different states depending on the requests it receives. mongosync can only be in a single state at a given time. The current mongosync states determines which API operations you can run.

Note

Most state transitions happen as the result of an API call. The exceptions are:

  • The transition from COMMITTING to COMMITTED. For more information, see Finalizing Sync.

  • The transition from REVERSING to RUNNING. For more information, see Reversing Sync.

This page describes mongosync states.

To view the current state of mongosync, use the /progress. endpoint. The /progress endpoint returns the state in the state field.

Note

Starting in mongosync 1.7.3, mongosync can take at least two minutes to respond when you resume or restart a sync operation. During this time, any calls to the progress endpoint might fail. If a progress call fails, it is safe to retry.

The following table describes each state and lists the permitted operations in that state.

State
Description
Possible API Operations

IDLE

mongosync is initialized and ready for a sync job to begin.

RUNNING

The sync process is currently running. In this state, data is initially synced to the destination cluster. Subsequent writes to the source cluster are applied to the destination cluster.

PAUSED

The sync process is paused. To resume the sync process, send a request to the /resume endpoint.

COMMITTING

The cutover for the sync process has started. The time it takes to transition to the COMMITTED phase depends on lagTimeSeconds. To monitor lagTimeSeconds or to see if mongosync has finished committing, use the /progress endpoint.

COMMITTED

The cutover for the sync process is complete.

REVERSING

The sync process copies metadata from the destination cluster to the source cluster. Then, MongoDB swaps the source and destination clusters and resumes applying change events.

Back

reverse