Mongosync how to continue after commited state

Hi, we are using mongosync to migrate data from one cluster to another cluster.

We have gone through the process and the data migrated fine and finally we committed everything.

curl localhost:27182/api/v1/commit -XPOST --data '{ }'

The mongosync is now in the following state:

curl localhost:27182/api/v1/progress -XGET

{"progress":{"state":"COMMITTED","canCommit":false,"canWrite":true,"info":"commit completed","lagTimeSeconds":0,"collectionCopy":{"estimatedTotalBytes":39744723179,"estimatedCopiedBytes":39744864710},"directionMapping":{"Source":"cluster0: mongo.acme.com:27017","Destination":"cluster1: mongo.acme-staging.com:27017"},"mongosyncID":"coordinator","coordinatorID":"coordinator"}}

Now that we know this works, we want to continue the process after it has been commited, since commiting, new data has been incoming and we want to fetch that new data (preferably without having to refetch everything again is that possible?).

Now we would like to continue and keep on syncing data, how do we “resume” or “start” the process again and continue fetching new data.

Trying to “start” or “restume” again using the api does not work

{"success":false,"error":"InvalidStateTransition","errorDescription":"Invalid state transition, expected Current State PAUSED, current State: COMMITTED, target State: RUNNING"}
{"success":false,"error":"InvalidStateTransition","errorDescription":"Invalid state transition, expected Current State IDLE, current State: COMMITTED, target State: RUNNING"}

We also tried starting the mongosync web server again but it knows its already in a commited state.

Hi Kay,

The COMMIT operation is irreversible, as its purpose is to enable the cutover to the new cluster. If you want to keep the sync going, then you don’t need to call Commit (you can still Pause the sync or shutdown the mongosync process as needed to pause the data replication). In the current state, unfortunately, you will have to do a full resync by dropping all the data on the destination database, including the “mongosync_reserved_for_internal_use” namespace.

-Alex

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.