[Groonga-commit] droonga/droonga-engine at 891b2a9 [master] Fire "join" event for the serf cluster if there is any new members

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Aug 28 19:25:08 JST 2014


YUKI Hiroshi	2014-08-28 19:25:08 +0900 (Thu, 28 Aug 2014)

  New Revision: 891b2a90cf526dad6c835f08b2ac8cb9b6c2b206
  https://github.com/droonga/droonga-engine/commit/891b2a90cf526dad6c835f08b2ac8cb9b6c2b206

  Message:
    Fire "join" event for the serf cluster if there is any new members

  Modified files:
    lib/droonga/command/remote.rb
    lib/droonga/serf.rb

  Modified: lib/droonga/command/remote.rb (+9 -0)
===================================================================
--- lib/droonga/command/remote.rb    2014-08-28 19:20:51 +0900 (8075fa7)
+++ lib/droonga/command/remote.rb    2014-08-28 19:25:08 +0900 (501743f)
@@ -168,6 +168,8 @@ module Droonga
             modifier.datasets[dataset_name].replicas.hosts += other_hosts
             modifier.datasets[dataset_name].replicas.hosts.uniq!
           end
+
+          Serf.join(*other_hosts)
         end
 
         def replica_hosts(catalog=nil)
@@ -291,6 +293,9 @@ module Droonga
           CatalogModifier.modify do |modifier|
             modifier.datasets[dataset].replicas.hosts = hosts
           end
+
+          Serf.join(*hosts)
+          #XXX Now we should restart serf agent to remove unjoined nodes from the list of members...
         end
       end
 
@@ -308,6 +313,8 @@ module Droonga
             modifier.datasets[dataset].replicas.hosts += hosts
             modifier.datasets[dataset].replicas.hosts.uniq!
           end
+
+          Serf.join(*hosts)
         end
       end
 
@@ -321,6 +328,8 @@ module Droonga
           CatalogModifier.modify do |modifier|
             modifier.datasets[dataset].replicas.hosts -= hosts
           end
+
+          #XXX Now we should restart serf agent to remove unjoined nodes from the list of members...
         end
       end
 

  Modified: lib/droonga/serf.rb (+4 -0)
===================================================================
--- lib/droonga/serf.rb    2014-08-28 19:20:51 +0900 (81b5e19)
+++ lib/droonga/serf.rb    2014-08-28 19:25:08 +0900 (ebccd50)
@@ -49,6 +49,10 @@ module Droonga
         new(nil, name).send_query(query, payload)
       end
 
+      def join(name, *hosts)
+        new(nil, name).join(*hosts)
+      end
+
       def live_nodes(name)
         new(nil, name).live_nodes
       end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index