Updated Branches: refs/heads/1.2.x c9a0d2af1 -> 421e6de00
Avoid confusing log messages when replication completes When a replication finishes, the replicator manager (database) will call couch_replicator:cancel_replication/1 with the purpose of ensuring the child spec is removed from the supervisor. This function however is used as well when users explicitly ask to cancel a replication, and logs messages which don't make sense when invoked by the replication manager (added by COUCHDB-1271). This change also adds a comment about this behaviour. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/421e6de0 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/421e6de0 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/421e6de0 Branch: refs/heads/1.2.x Commit: 421e6de00b0c514dba9ce7bec956116baa5b6488 Parents: c9a0d2a Author: Filipe David Borba Manana <fdman...@apache.org> Authored: Sun Nov 13 11:46:01 2011 +0000 Committer: Filipe David Borba Manana <fdman...@apache.org> Committed: Sun Nov 13 11:55:25 2011 +0000 ---------------------------------------------------------------------- src/couchdb/couch_replication_manager.erl | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/421e6de0/src/couchdb/couch_replication_manager.erl ---------------------------------------------------------------------- diff --git a/src/couchdb/couch_replication_manager.erl b/src/couchdb/couch_replication_manager.erl index 7d1860e..1c038d6 100644 --- a/src/couchdb/couch_replication_manager.erl +++ b/src/couchdb/couch_replication_manager.erl @@ -416,10 +416,15 @@ start_replication(Rep, Wait) -> replication_complete(DocId) -> case ets:lookup(?DOC_TO_REP, DocId) of - [{DocId, RepId}] -> + [{DocId, {BaseId, Ext} = RepId}] -> case rep_state(RepId) of nil -> - couch_replicator:cancel_replication(RepId); + % Prior to OTP R14B02, temporary child specs remain in + % in the supervisor after a worker finishes - remove them. + % We want to be able to start the same replication but with + % eventually different values for parameters that don't + % contribute to its ID calculation. + _ = supervisor:delete_child(couch_rep_sup, BaseId ++ Ext); #rep_state{} -> ok end,