You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Anton Lindström <ca...@gmail.com> on 2017/02/06 20:53:02 UTC

Detect failed replication tasks

Hi,

I'm having some troubles with detecting connection failures in a continuous
replication between two CouchDB 2.0 instances. My goal is to replicate a
database from instance A to instance B and if something goes wrong, I need
a way to detect that fast. If I start a replication and then kill instance
A (^C), it takes over 2 minutes before the `replication_state` changes from
`triggered` to `error`. I'm using the following replicator settings:

[replicator]
max_replication_retry_count = 0
connection_timeout = 4000
retries_per_request = 1

The replication job is created on instance B like this:

curl -XPUT http://instance-b/_replicator -d '{
    "_id": "my_replication",
    "source":  "http://instance-a:5984/test/",
    "target":  "http://127.0.0.1:5984/test/",
    "create_target":  true,
    "continuous":  true
}'

The reasoning behind the low retry numbers was to make the replication job
fail fast so that we know that instance B can contain stale documents. It
doesn't seem to work though :)
Is it possible to detect these kinds of errors in, let's say, 10 seconds?


Thanks,
Anton