recoverd: Do not send "ipreallocated" event to stopped nodes
authorMartin Schwenke <martin@meltin.net>
Mon, 18 Feb 2013 05:32:14 +0000 (16:32 +1100)
committerMartin Schwenke <martin@meltin.net>
Wed, 20 Feb 2013 04:09:19 +0000 (15:09 +1100)
Stopped nodes will reject "ipreallocated" because they are in
recovery, so they will eventually be banned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>

server/ctdb_takeover.c

index e17b481ef0bfc3dabfa28c3984f8f1cfab2e8e5c..1e8dc757c5dafc0a26f4a59bc51a5ec9f862dff4 100644 (file)
@@ -2074,11 +2074,18 @@ int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
        }
 
 ipreallocated:
-       /* tell all nodes to update natwg */
-       /* send the flags update natgw on all connected nodes */
+       /*
+        * Tell all connected, but not stopped (since they are in
+        * recovery and will reject the event), nodes to run
+        * eventscripts to process the "ipreallocated" event.  This
+        * can do a lot of things, including restarting services to
+        * reconfigure them if public IPs have moved.  Once upon a
+        * time this event only used to update natwg.
+        */
        data.dptr  = discard_const("ipreallocated");
        data.dsize = strlen((char *)data.dptr) + 1; 
-       nodes = list_of_connected_nodes(ctdb, nodemap, tmp_ctx, true);
+       nodes = list_of_nodes(ctdb, nodemap, tmp_ctx,
+                             NODE_FLAGS_DISCONNECTED|NODE_FLAGS_STOPPED, -1);
        if (ctdb_client_async_control(ctdb, CTDB_CONTROL_RUN_EVENTSCRIPTS,
                                      nodes, 0, TAKEOVER_TIMEOUT(),
                                      false, data,