[Groonga-commit] droonga/droonga-engine at 1e7c429 [master] Wait until remaining node is completely restarted

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 15:47:16 JST 2015


YUKI Hiroshi	2015-04-21 15:47:16 +0900 (Tue, 21 Apr 2015)

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

  Message:
    Wait until remaining node is completely restarted

  Modified files:
    bin/droonga-engine-unjoin

  Modified: bin/droonga-engine-unjoin (+8 -6)
===================================================================
--- bin/droonga-engine-unjoin    2015-04-21 15:46:45 +0900 (a8b2733)
+++ bin/droonga-engine-unjoin    2015-04-21 15:47:16 +0900 (f3b6b07)
@@ -122,6 +122,11 @@ module Droonga
       @remaining_node ||= detect_remaining_node
     end
 
+    def remaining_node_serf
+      @remaining_node_serf ||= Serf.new(remaining_node,
+                                        :verbose => @options[:verbose])
+    end
+
     def detect_remaining_node
       generator = Catalog::Generator.new
       generator.load(raw_catalog)
@@ -139,18 +144,15 @@ module Droonga
       "#{remaining_host}:#{port}/#{tag}"
     end
 
-    def run_remote_command(target, command, options)
-      serf = Serf.new(target, :verbose => @options[:verbose])
-      serf.send_query(command, options)
-    end
-
     def do_unjoin
       puts "Unjoining replica from the cluster..."
 
-      run_remote_command(remaining_node, "unjoin",
+      remaining_node_serf.ensure_restarted do
+      remaining_node_serf.send_query("unjoin",
                          "cluster_id" => cluster_id,
                          "dataset" => dataset_name,
                          "hosts"   => [replica_remove_host])
+      end
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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