From d83235b3ccf4e15ceac51dd78d11b810e0e87cbe Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sat, 2 Jul 2011 18:52:14 +0000 Subject: 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 --- apps/couch/src/couch_replication_manager.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'apps') 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. -- cgit v1.2.3