couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1142262 - /couchdb/trunk/src/couchdb/couch_replication_manager.erl
Date Sat, 02 Jul 2011 18:51:24 GMT
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.
 



Mime
View raw message