[Groonga-commit] droonga/droonga-engine at bbd2535 [master] Don't forward "read" messages to nodes not completely updated

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Apr 1 14:48:41 JST 2015


YUKI Hiroshi	2015-04-01 14:48:41 +0900 (Wed, 01 Apr 2015)

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

  Message:
    Don't forward "read" messages to nodes not completely updated

  Modified files:
    lib/droonga/cluster.rb
    lib/droonga/dispatcher.rb
    lib/droonga/engine_node.rb

  Modified: lib/droonga/cluster.rb (+4 -4)
===================================================================
--- lib/droonga/cluster.rb    2015-04-01 13:31:36 +0900 (0395a8f)
+++ lib/droonga/cluster.rb    2015-04-01 14:48:41 +0900 (df6d306)
@@ -143,9 +143,9 @@ module Droonga
       false
     end
 
-    def forwardable_nodes
-      @forwardable_nodes ||= engine_nodes.select do |node|
-        node.forwardable?
+    def readable_nodes
+      @readable_nodes ||= engine_nodes.select do |node|
+        node.readable?
       end.collect(&:name)
     end
 
@@ -159,7 +159,7 @@ module Droonga
     def clear_cache
       @engine_nodes.each(&:shutdown) if @engine_nodes
       @engine_nodes      = nil
-      @forwardable_nodes = nil
+      @readable_nodes = nil
       @writable_nodes    = nil
     end
 

  Modified: lib/droonga/dispatcher.rb (+2 -2)
===================================================================
--- lib/droonga/dispatcher.rb    2015-04-01 13:31:36 +0900 (8102d11)
+++ lib/droonga/dispatcher.rb    2015-04-01 14:48:41 +0900 (a636982)
@@ -217,7 +217,7 @@ module Droonga
                            :step      => step)
             end
           else
-            target_nodes =****@clust*****_nodes
+            target_nodes =****@clust*****_nodes
             if target_nodes.empty?
               logger.error("there is no node to dispath a read step!",
                            :my_role   => @engine_state.role,
@@ -394,7 +394,7 @@ module Droonga
       end
 
       def select_responsive_routes(routes)
-        selected_nodes =****@clust*****_nodes
+        selected_nodes =****@clust*****_nodes
         routes.select do |route|
           selected_nodes.include?(@engine_state.farm_path(route))
         end

  Modified: lib/droonga/engine_node.rb (+7 -1)
===================================================================
--- lib/droonga/engine_node.rb    2015-04-01 13:31:36 +0900 (2e68d5d)
+++ lib/droonga/engine_node.rb    2015-04-01 14:48:41 +0900 (58e0af5)
@@ -70,6 +70,10 @@ module Droonga
       role == sender_role
     end
 
+    def readable?
+      forwardable? and****@buffe*****?
+    end
+
     def writable?
       case sender_role
       when NodeMetadata::Role::SERVICE_PROVIDER
@@ -84,8 +88,10 @@ module Droonga
     end
 
     def status
-      if forwardable?
+      if readable?
         "active"
+      elsif forwardable?
+        "inactive"
       elsif dead?
         "dead"
       else
-------------- next part --------------
HTML����������������������������...
下载 



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