summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-07-02 18:52:14 +0000
committerRobert Newson <robert.newson@cloudant.com>2011-07-05 12:38:21 +0100
commitd83235b3ccf4e15ceac51dd78d11b810e0e87cbe (patch)
treea06963790f067c13fdeead983050b8941ec5eb75 /apps
parent571d63d20b8f20dc662d755248c9fafe47811782 (diff)
Merged revision 1142262 from trunk
On server startup, restart replications in error If we setup a continuous replication which goes into an error state and restart Couch just before the replication is retried (before it transitions to the triggered state), the user has to manually restart the replication (recreating the document or deleting its _replication_state field). git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1142263 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'apps')
-rw-r--r--apps/couch/src/couch_replication_manager.erl9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/couch/src/couch_replication_manager.erl b/apps/couch/src/couch_replication_manager.erl
index 943cafa8..b3fc3e3c 100644
--- a/apps/couch/src/couch_replication_manager.erl
+++ b/apps/couch/src/couch_replication_manager.erl
@@ -314,8 +314,13 @@ process_update(State, {Change}) ->
<<"completed">> ->
replication_complete(DocId),
State;
- _ ->
- State
+ <<"error">> ->
+ case ets:lookup(?DOC_TO_REP, DocId) of
+ [] ->
+ maybe_start_replication(State, DocId, JsonRepDoc);
+ _ ->
+ State
+ end
end
end.