You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2014/08/28 19:30:04 UTC

[04/50] [abbrv] couch-replicator commit: updated refs/heads/1963-eunit-bigcouch to 3cf0b13

Cancel replication jobs on every node, not just owner node

It is safe to attempt to cancel a job owned by another node, just in
case ownership changed at the same time as the document was deleted.

BugzID: 19518


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/dd96e219
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/dd96e219
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/dd96e219

Branch: refs/heads/1963-eunit-bigcouch
Commit: dd96e21930032fe6a2f6707ba3031268cc4ee187
Parents: ed447f8
Author: Robert Newson <ro...@cloudant.com>
Authored: Tue May 7 17:05:08 2013 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Jul 29 13:22:05 2014 +0100

----------------------------------------------------------------------
 src/couch_replicator_manager.erl | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/dd96e219/src/couch_replicator_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl
index 6afddd8..71e6be0 100644
--- a/src/couch_replicator_manager.erl
+++ b/src/couch_replicator_manager.erl
@@ -346,12 +346,11 @@ process_update(State, DbName, {Change}) ->
     {RepProps} = JsonRepDoc = get_json_value(doc, Change),
     DocId = get_json_value(<<"_id">>, RepProps),
     case {is_owner(DbName, DocId), get_json_value(deleted, Change, false)} of
-    {false, _} ->
-        replication_complete(DbName, DocId),
-        State;
-    {true, true} ->
+    {_, true} ->
         rep_doc_deleted(DbName, DocId),
         State;
+    {false, false} ->
+        State;
     {true, false} ->
         case get_json_value(<<"_replication_state">>, RepProps) of
         undefined ->