The branch, 1.2.40 has been updated via 49bab583f430b5c06178c2cd114d2362cf1d606c (commit) via b129e5223eb77a08b8ee3d36aa59d36957699971 (commit) from 158a1e8d045c4b65dd3f52eb70535e446ec4fb48 (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2.40 - Log ----------------------------------------------------------------- commit 49bab583f430b5c06178c2cd114d2362cf1d606c Author: Martin Schwenke <mar...@meltin.net> Date: Mon Feb 18 16:32:14 2013 +1100 recoverd: Do not send "ipreallocated" event to stopped nodes Stopped nodes will reject "ipreallocated" because they are in recovery, so they will eventually be banned. Signed-off-by: Martin Schwenke <mar...@meltin.net> Pair-programmed-with: Amitay Isaacs <ami...@gmail.com> Cherry-pick-from: c270381ee81903ff459a8b23fd57c997d038cf14 commit b129e5223eb77a08b8ee3d36aa59d36957699971 Author: Martin Schwenke <mar...@meltin.net> Date: Tue Feb 19 14:29:06 2013 +1100 client: New generic node listing function list_of_nodes() Signed-off-by: Martin Schwenke <mar...@meltin.net> Pair-programmed-with: Amitay Isaacs <ami...@gmail.com> Cherry-pick-from: a73bb56991b8c07ed0e9517ffcf0dc264be30487 ----------------------------------------------------------------------- Summary of changes: client/ctdb_client.c | 38 ++++++++++++++++++++++++++++++++++++++ include/ctdb_client.h | 5 +++++ server/ctdb_takeover.c | 13 ++++++++++--- 3 files changed, 53 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 739c21b..4a02ae5 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -3408,6 +3408,44 @@ uint32_t *list_of_vnnmap_nodes(struct ctdb_context *ctdb, return nodes; } +/* Get list of nodes not including those with flags specified by mask. + * If exclude_pnn is not -1 then exclude that pnn from the list. + */ +uint32_t *list_of_nodes(struct ctdb_context *ctdb, + struct ctdb_node_map *node_map, + TALLOC_CTX *mem_ctx, + uint32_t mask, + int exclude_pnn) +{ + int i, j, num_nodes; + uint32_t *nodes; + + for (i=num_nodes=0;i<node_map->num;i++) { + if (node_map->nodes[i].flags & mask) { + continue; + } + if (node_map->nodes[i].pnn == exclude_pnn) { + continue; + } + num_nodes++; + } + + nodes = talloc_array(mem_ctx, uint32_t, num_nodes); + CTDB_NO_MEMORY_FATAL(ctdb, nodes); + + for (i=j=0;i<node_map->num;i++) { + if (node_map->nodes[i].flags & mask) { + continue; + } + if (node_map->nodes[i].pnn == exclude_pnn) { + continue; + } + nodes[j++] = node_map->nodes[i].pnn; + } + + return nodes; +} + uint32_t *list_of_active_nodes(struct ctdb_context *ctdb, struct ctdb_node_map *node_map, TALLOC_CTX *mem_ctx, diff --git a/include/ctdb_client.h b/include/ctdb_client.h index ad31d24..69467c5 100644 --- a/include/ctdb_client.h +++ b/include/ctdb_client.h @@ -490,6 +490,11 @@ int ctdb_ctrl_setreclock(struct ctdb_context *ctdb, const char *reclock); +uint32_t *list_of_nodes(struct ctdb_context *ctdb, + struct ctdb_node_map *node_map, + TALLOC_CTX *mem_ctx, + uint32_t mask, + int exclude_pnn); uint32_t *list_of_connected_nodes(struct ctdb_context *ctdb, struct ctdb_node_map *node_map, TALLOC_CTX *mem_ctx, diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c index 83b9347..5704b09 100644 --- a/server/ctdb_takeover.c +++ b/server/ctdb_takeover.c @@ -2125,11 +2125,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, -- CTDB repository