[Groonga-commit] droonga/droonga-engine at 1f9f1f8 [master] Don't trigger restarting by changes of non-critical informations in the cluster-state.json

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 23 21:38:46 JST 2015


YUKI Hiroshi	2015-04-23 21:38:46 +0900 (Thu, 23 Apr 2015)

  New Revision: 1f9f1f8ed52287c8f0d1205b97c656f9f24878c6
  https://github.com/droonga/droonga-engine/commit/1f9f1f8ed52287c8f0d1205b97c656f9f24878c6

  Message:
    Don't trigger restarting by changes of non-critical informations in the cluster-state.json

  Modified files:
    lib/droonga/command/droonga_engine.rb

  Modified: lib/droonga/command/droonga_engine.rb (+11 -5)
===================================================================
--- lib/droonga/command/droonga_engine.rb    2015-04-23 21:03:10 +0900 (9b997a3)
+++ lib/droonga/command/droonga_engine.rb    2015-04-23 21:38:46 +0900 (c4aa4ad)
@@ -597,6 +597,10 @@ module Droonga
           catalog_observer
         end
 
+        RESTART_TRIGGER_KEYS = [
+          "role",
+        ]
+
         def run_cluster_state_observer
           previous_state = nil
           cluster_state_observer = FileObserver.new(@loop, Path.cluster_state)
@@ -604,12 +608,14 @@ module Droonga
             my_name   =****@confi*****_name
             new_state = Cluster.load_state_file
             if new_state and previous_state
-              my_new_state = new_state[my_name].dup
-              my_new_state.delete("internal_name")
-              my_previous_state = previous_state[my_name].dup
-              my_previous_state.delete("internal_name")
+              my_new_state = new_state[my_name].select do |key, _value|
+                RESTART_TRIGGER_KEYS.include?(key)
+              end
+              my_previous_state = previous_state[my_name].select do |key, _value|
+                RESTART_TRIGGER_KEYS.include?(key)
+              end
               if my_new_state != my_previous_state
-                logger.info("restart by updated cluster-state.json",
+                logger.info("restart by changes of myself in cluster-state.json",
                             :previous => my_previous_state,
                             :new      => my_new_state,
                             :diff     => Differ.diff(my_previous_state, my_new_state))
-------------- next part --------------
HTML����������������������������...
Download 



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