Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5FC39200B3C for ; Fri, 3 Jun 2016 17:17:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5ECC7160A57; Fri, 3 Jun 2016 15:17:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 311AF160A56 for ; Fri, 3 Jun 2016 17:17:28 +0200 (CEST) Received: (qmail 33886 invoked by uid 500); 3 Jun 2016 15:17:26 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 33263 invoked by uid 99); 3 Jun 2016 15:17:25 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2016 15:17:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B01D1E9E9B; Fri, 3 Jun 2016 15:17:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Fri, 03 Jun 2016 15:17:39 -0000 Message-Id: <6884dc1d0e354086a5205c610a461015@git.apache.org> In-Reply-To: <7088f4f31da4493b8d77cf6631b794ee@git.apache.org> References: <7088f4f31da4493b8d77cf6631b794ee@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [15/30] couch-replicator commit: updated refs/heads/63012-scheduler-dont-start-immediately to 6a913dc archived-at: Fri, 03 Jun 2016 15:17:29 -0000 Update couch_replicator_sup. Move clustering and event manager to the top. - If `_clustering` crashes we'd have to restart scheduler. Replication used clustering module to decide if they should still run on current. Node. Move clustering before scheduler in child order. If scheduler crashes, clustering doesn't need to be restarted. - If event manager crashes, replications running in scheduler need to restart. So it should move above the scheduler. If scheduler crashes event manager can be still left running. Other dependencies: * `_scheduler` needs `_scheduler_sup` * Replications spawned from `_multidb_changes` need `_scheduler`, event manager, and `_clustering`. * If `_clustering` fails we want `_multidb_changes` to restart. * If `_multidb_changes` fails, other children don't need to restart. * If `_scheduler` crashes, we want to `multidb_changes` to restart so it can rescan and re-add the jobs. 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/6746aadb Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/6746aadb Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/6746aadb Branch: refs/heads/63012-scheduler-dont-start-immediately Commit: 6746aadb8aca20e81dd5ffa56f07f24cca3142ca Parents: fd06ae1 Author: Nick Vatamaniuc Authored: Mon May 23 17:53:27 2016 -0400 Committer: Nick Vatamaniuc Committed: Mon May 23 17:53:27 2016 -0400 ---------------------------------------------------------------------- src/couch_replicator_sup.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/6746aadb/src/couch_replicator_sup.erl ---------------------------------------------------------------------- diff --git a/src/couch_replicator_sup.erl b/src/couch_replicator_sup.erl index 6870d3c..6510604 100644 --- a/src/couch_replicator_sup.erl +++ b/src/couch_replicator_sup.erl @@ -26,30 +26,30 @@ init(_Args) -> [skip_ddocs] % Options ], Children = [ - {couch_replicator_scheduler_sup, - {couch_replicator_scheduler_sup, start_link, []}, - permanent, - infinity, - supervisor, - [couch_replicator_scheduler_sup]}, - {couch_replicator_scheduler, - {couch_replicator_scheduler, start_link, []}, + {couch_replicator_clustering, + {couch_replicator_clustering, start_link, []}, permanent, brutal_kill, worker, - [couch_replicator_scheduler]}, + [couch_replicator_clustering]}, {couch_replication_event, {gen_event, start_link, [{local, couch_replication}]}, permanent, brutal_kill, worker, dynamic}, - {couch_replicator_clustering, - {couch_replicator_clustering, start_link, []}, + {couch_replicator_scheduler_sup, + {couch_replicator_scheduler_sup, start_link, []}, + permanent, + infinity, + supervisor, + [couch_replicator_scheduler_sup]}, + {couch_replicator_scheduler, + {couch_replicator_scheduler, start_link, []}, permanent, brutal_kill, worker, - [couch_replicator_clustering]}, + [couch_replicator_scheduler]}, {couch_replicator, % This is simple function call which does not create a process % but returns `ignore`. It is used to make sure each node