incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Cottlehuber <...@jsonified.com>
Subject Re: Problem with restart of continuous replication
Date Tue, 23 Apr 2013 08:28:45 GMT
On 23 April 2013 09:01, Calle Arnesten <calle.arnesten@codekick.com> wrote:
> Hi,
>
> I have a two-way continuous replication set up between two servers with CouchDB. About
a week ago we had a DNS problem that caused the machines to not to be able to communicate
for almost 2 hours. My assumption was that CouchDB would automatically try to restart the
replication. When I double-checked this a day or two later, replication was only restarted
for one way and not both. After rebooting the machine the replication started working both
ways again.
>
> Now my question is: Was my assumption wrong that replication should be restarted automatically?
If not, what could be the cause of it not working? The machine that it happened to have CouchDB
1.2.1 installed.

replication will retry a certain number of times and then give up if
the connection does not work, 10 by default.

See http://wiki.apache.org/couchdb/Replication#New_features_introduced_in_CouchDB_1.2.0
for the details.

> Also, do you have any recommendations on how to monitor that replication works and notify
by mail when it doesn't?

I'd suggest one of 2 things, not having used either personally -


use the replicator DB mentioned in the above link, and monitor the
state of that named document:

GET /_replicator/my_replication_task

You'll get something back like this:

{
   "_id": "my_replication_task",
   "_rev": "2-539eca65da0cfbd416fb335dcc5129c2",
   "source": "http://somewhere.iriscouch.com/mydb/",
   "target": "mydb",
   "create_target": true,
   "continuous": true,
   "owner": "admin",
   "_replication_state": "error",
   "_replication_state_time": "2013-04-22T18:31:44+02:00",
   "_replication_id": "f1bdf920b49bb9156b2c3147f30d18c3"
}

Which seems self-explanatory.

The other option is to GET /_active_tasks

[
    {
        "checkpointed_source_seq": 307493,
        "continuous": true,
        "doc_id": "my_replication_task",
        "doc_write_failures": 0,
        "docs_read": 0,
        "docs_written": 0,
        "missing_revisions_found": 0,
        "pid": "<0.300.0>",
        "progress": 70,
        "replication_id": "1d1f73e98957aa03e3fa9291e05ed7e0+continuous",
        "revisions_checked": 3962,
        "source": http://somewhere.iriscouch.com/mydb/",
        "source_seq": 461843,
        "started_on": 1366705545,
        "target": "mydb",
        "type": "replication",
        "updated_on": 1366705552
    }
]

Which for a continuous replication should always be present.

A+
Dave

Mime
View raw message