question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v1.3 Continuous replication stops on change tracker error

See original GitHub issue

Our client app is reporting on the replication state and needs to ensure the continuous replication never goes into a stopped state else this can be confusing when trying to diagnose issues.

According to CB Lite API Documentation the stopped state represents the following: “Stopped: A one-shot replication goes into this state after all documents have been transferred or a fatal error occurs. (Continuous replications never stop.)” Note: continuous replication should never stop and always go into a re-try AwaitingChanges state by default

But I’ve seen it is possible for continuous replication to go into a stopped state. When the change tracker experiences a non-transient error and there are no more changes left to download it calls: ProcessChangeTrackerStopped And in that method the following logic is called which puts continuous replication in a stopped state:

 if (ChangesCount == CompletedChangesCount && IsSafeToStop) {
      Log.To.Sync.V(TAG, "Change tracker stopped, firing StopGraceful...");
      FireTrigger(ReplicationTrigger.StopGraceful);
  }

We are looking to deploy to production soon with v1.3 but I am worried that the continous replication can go into a “stopped” state as we assumed this was not possible, and as I said, can be confusing when trying to diagnose issues.

Would you be able to suggest a workaround in the interim. I’m prepared to just resolve my side in a Fork if necessary. Can I simply add a “&& !Continuous” check to the above logic. Any suggestions would be much appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
borrrdencommented, Aug 23, 2016

Ok I brought this up with the team and we are going to once and for all make a document with the definitive answer for this since we cannot all seem to remember the same version. So far it seems that continuous replication should never stop, as in the docs and so I will move forward with that in mind. After the document has been reviewed and finalized I will make the final changes.

P.S. What is the error that causes the stoppage?

0reactions
borrrdencommented, Sep 13, 2016

@Steven-Mark-Ford I refactored the retry logic into a completely central place to make it more unit testable, but it’s a pretty big change so I pushed it up onto a branch. If you want, you can give the source on the issue/718 branch a shot and see if your issue resolves.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replication does not continue when back online
Only when I stop the the replication and start it does sync resume. We use continuous replication for both the pull and push...
Read more >
Pull replication(or sync) fails with remote sync gateway
SystemLogger e SEVERE : Sync: Change tracker stopped during continuous replication PULL replication event. Source: com.couchbase.lite.replicator.
Read more >
Bucket replication issues
To adjust the allowable number of replication errors, you can configure the max_replication_errors attribute in server.conf on the source peer. However, it is ......
Read more >
Patch 3 Release Notes for Veeam Backup & Replication 7.0
Solution ; Changed Block Tracking fails on dynamic VHD disk aligned to 1024 bytes with the "Failed to update unaccounted changes for disk....
Read more >
Troubleshooting Geo
That is, the Geo tracking database. This error message indicates that the replica database in the secondary site is misconfigured and replication has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found