[Groonga-commit] droonga/droonga-engine at 21d97f5 [master] Don't restart cluster twice on changing role

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Mar 24 13:44:02 JST 2015


YUKI Hiroshi	2015-03-24 13:44:02 +0900 (Tue, 24 Mar 2015)

  New Revision: 21d97f522fccc7a09404a410076db22d78814181
  https://github.com/droonga/droonga-engine/commit/21d97f522fccc7a09404a410076db22d78814181

  Message:
    Don't restart cluster twice on changing role

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

  Modified: lib/droonga/command/remote.rb (+1 -1)
===================================================================
--- lib/droonga/command/remote.rb    2015-03-24 13:41:20 +0900 (3cd6151)
+++ lib/droonga/command/remote.rb    2015-03-24 13:44:02 +0900 (8d0cada)
@@ -110,9 +110,9 @@ module Droonga
       class ChangeRole < Base
         def process
           log("old role: #{@serf.role}")
+          # this changes cluster information and triggers restarting!
           @serf.role = @params["role"]
           log("new role: #{@serf.role}")
-          Restarter.restart
         end
       end
 

  Modified: lib/droonga/serf.rb (+2 -1)
===================================================================
--- lib/droonga/serf.rb    2015-03-24 13:41:20 +0900 (815b214)
+++ lib/droonga/serf.rb    2015-03-24 13:44:02 +0900 (f70c8b9)
@@ -146,8 +146,9 @@ module Droonga
 
     def role=(new_role)
       new_role ||= NodeMetadata::Role::SERVICE_PROVIDER
-      set_tag("role", new_role)
       @node_metadata.role = new_role
+      # this changes cluster information and triggers restarting!
+      set_tag("role", new_role)
     end
 
     def cluster_id
-------------- next part --------------
HTML����������������������������...
Download 



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