[Groonga-commit] droonga/droonga-engine at 1c91d34 [buffered-forward] Join to the cluster before absorb

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Jan 15 17:24:45 JST 2015


YUKI Hiroshi	2015-01-15 17:24:45 +0900 (Thu, 15 Jan 2015)

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

  Message:
    Join to the cluster before absorb

  Modified files:
    bin/droonga-engine-join
    lib/droonga/command/remote.rb

  Modified: bin/droonga-engine-join (+0 -8)
===================================================================
--- bin/droonga-engine-join    2015-01-15 17:20:36 +0900 (c2614aa)
+++ bin/droonga-engine-join    2015-01-15 17:24:45 +0900 (ed79599)
@@ -152,10 +152,6 @@ class JoinCommand
                          "node" => source_node,
                          "role" => Droonga::NodeMetadata::Role::ABSORB_SOURCE)
     end
-    run_remote_command(joining_node, "change_role",
-                       "node" => joining_node,
-                       "role" => Droonga::NodeMetadata::Role::ABSORB_DESTINATION)
-    @node_role_changed = true
   end
 
   def reset_node_role
@@ -164,10 +160,6 @@ class JoinCommand
                          "node" => source_node,
                          "role" => nil)
     end
-    run_remote_command(joining_node, "change_role",
-                       "node" => joining_node,
-                       "role" => nil)
-    @node_role_changed = false
   end
 
   def do_join

  Modified: lib/droonga/command/remote.rb (+6 -2)
===================================================================
--- lib/droonga/command/remote.rb    2015-01-15 17:20:36 +0900 (e12b93d)
+++ lib/droonga/command/remote.rb    2015-01-15 17:24:45 +0900 (329d3ef)
@@ -192,14 +192,14 @@ module Droonga
           log("other_hosts = #{other_hosts}")
           return if other_hosts.empty?
 
+          @serf.role = NodeMetadata::Role::ABSORB_DESTINATION
+
           # restart self with the fetched catalog.
           SafeFileWriter.write(Path.catalog) do |output, file|
             output.puts(JSON.pretty_generate(@catalog))
             @service_installation.ensure_correct_file_permission(file)
           end
 
-          absorb_data if should_absorb_data?
-
           log("joining to the cluster: update myself")
 
           CatalogModifier.modify do |modifier, file|
@@ -209,6 +209,10 @@ module Droonga
           end
 
           @serf.join(*other_hosts)
+
+          absorb_data if should_absorb_data?
+
+          @serf.role = nil
         end
 
         def replica_hosts
-------------- next part --------------
HTML����������������������������...
下載 



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