YUKI Hiroshi
null+****@clear*****
Thu Jun 26 18:47:29 JST 2014
YUKI Hiroshi 2014-06-26 18:47:29 +0900 (Thu, 26 Jun 2014) New Revision: 9864287b0ad2720543c5c2e6658fe9924678cd9c https://github.com/droonga/droonga-engine/commit/9864287b0ad2720543c5c2e6658fe9924678cd9c Message: Send message to dead nodes if it is "write" step Modified files: lib/droonga/dispatcher.rb Modified: lib/droonga/dispatcher.rb (+13 -1) =================================================================== --- lib/droonga/dispatcher.rb 2014-06-26 17:44:06 +0900 (2bfba2a) +++ lib/droonga/dispatcher.rb 2014-06-26 18:47:29 +0900 (84861a6) @@ -174,7 +174,9 @@ module Droonga steps.each do |step| dataset =****@catal*****(step["dataset"]) if dataset - routes = dataset.get_routes(step, @engine_state.live_nodes) + target_nodes = nil + target_nodes = @engine_state.live_nodes unless write_step?(step) + routes = dataset.get_routes(step, target_nodes) step["routes"] = routes else step["routes"] ||= [id] @@ -211,6 +213,16 @@ module Droonga @engine_state.local_route?(route) end + def write_step?(step) + step_runner = @step_runners[step["dataset"]] + return false unless step_runner + + step_definition = step_runner.find(step["command"]) + return false unless step_definition + + step_definition.write? + end + private def farm_path(route) @engine_state.farm_path(route) -------------- next part -------------- HTML����������������������������...Download