[Groonga-commit] droonga/droonga-engine at a1d4fa8 [master] Don't wait responses from suspended nodes

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Dec 11 18:58:13 JST 2014


YUKI Hiroshi	2014-12-11 18:58:13 +0900 (Thu, 11 Dec 2014)

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

  Merged 97ba0d9: Merge ../droonga-engine into replicas-in-a-branch

  Message:
    Don't wait responses from suspended nodes

  Modified files:
    lib/droonga/dispatcher.rb
    lib/droonga/engine_state.rb

  Modified: lib/droonga/dispatcher.rb (+8 -3)
===================================================================
--- lib/droonga/dispatcher.rb    2014-12-11 18:53:05 +0900 (bae1c6f)
+++ lib/droonga/dispatcher.rb    2014-12-11 18:58:13 +0900 (f774a0f)
@@ -192,7 +192,12 @@ module Droonga
       steps.each do |step|
         dataset =****@catal*****(step["dataset"])
         if dataset
-          routes = dataset.compute_routes(step, @engine_state.active_nodes)
+          if write_step?(step)
+            target_nodes = @engine_state.live_nodes
+          else
+            target_nodes = @engine_state.active_nodes
+          end
+          routes = dataset.compute_routes(step, target_nodes)
           step["routes"] = routes
         else
           step["routes"] ||= [id]
@@ -345,8 +350,8 @@ module Droonga
           (step["outputs"] || []).each do |output|
             descendants[output] = []
             @descendants[output].each do |index|
-              live_routes = @engine_state.remove_dead_routes(step["routes"])
-              @steps[index]["n_of_expects"] += live_routes.size
+              active_routes = @engine_state.remove_inactive_routes(step["routes"])
+              @steps[index]["n_of_expects"] += active_routes.size
               descendants[output].concat(@steps[index]["routes"])
             end
           end

  Modified: lib/droonga/engine_state.rb (+3 -2)
===================================================================
--- lib/droonga/engine_state.rb    2014-12-11 18:53:05 +0900 (9dd2857)
+++ lib/droonga/engine_state.rb    2014-12-11 18:58:13 +0900 (1ec2eb9)
@@ -154,9 +154,10 @@ module Droonga
       @live_nodes_list
     end
 
-    def remove_dead_routes(routes)
+    def remove_inactive_routes(routes)
       routes.reject do |route|
-        dead_nodes.include?(farm_path(route))
+        node = farm_path(route)
+        dead_nodes.include?(node) or suspended_nodes.include?(node)
       end
     end
 
-------------- next part --------------
HTML����������������������������...
다운로드 



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