You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/07/02 20:51:24 UTC

svn commit: r1142262 - /couchdb/trunk/src/couchdb/couch_replication_manager.erl

Author: fdmanana
Date: Sat Jul  2 18:51:24 2011
New Revision: 1142262

URL: http://svn.apache.org/viewvc?rev=1142262&view=rev
Log:
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).


Modified:
    couchdb/trunk/src/couchdb/couch_replication_manager.erl

Modified: couchdb/trunk/src/couchdb/couch_replication_manager.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_replication_manager.erl?rev=1142262&r1=1142261&r2=1142262&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_replication_manager.erl (original)
+++ couchdb/trunk/src/couchdb/couch_replication_manager.erl Sat Jul  2 18:51:24 2011
@@ -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.