couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [15/30] couch-replicator commit: updated refs/heads/63012-scheduler-dont-start-immediately to 6a913dc
Date Fri, 03 Jun 2016 15:17:39 GMT
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 <vatamane@gmail.com>
Authored: Mon May 23 17:53:27 2016 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
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


Mime
View raw message