The branch, 1.2.39 has been updated via a1c04ba95aa21837b8388f91480122e3349d3e92 (commit) via c270381ee81903ff459a8b23fd57c997d038cf14 (commit) via 61ac25e266d101c1ac979a4f3c765d4536cd7ccb (commit) from 12c9737e00f548599ea88b644b625be72466bb8b (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2.39 - Log ----------------------------------------------------------------- commit a1c04ba95aa21837b8388f91480122e3349d3e92 Author: Martin Schwenke <mar...@meltin.net> Date: Wed Feb 20 15:53:17 2013 +1100 New version 1.2.39-8 Signed-off-by: Martin Schwenke <mar...@meltin.net> commit c270381ee81903ff459a8b23fd57c997d038cf14 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> commit 61ac25e266d101c1ac979a4f3c765d4536cd7ccb 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 +++++ packaging/RPM/ctdb.spec.in | 4 +++- server/ctdb_takeover.c | 13 ++++++++++--- 4 files changed, 56 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 5e06604..7e2dd4a 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -3176,6 +3176,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 3dc115f..9498791 100644 --- a/include/ctdb_client.h +++ b/include/ctdb_client.h @@ -486,6 +486,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/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in index 5165c5c..1d9781d 100644 --- a/packaging/RPM/ctdb.spec.in +++ b/packaging/RPM/ctdb.spec.in @@ -4,7 +4,7 @@ Summary: Clustered TDB Vendor: Samba Team Packager: Samba Team <sa...@samba.org> Version: 1.2.39 -Release: 7GITHASH +Release: 8GITHASH Epoch: 0 License: GNU GPL version 3 Group: System Environment/Daemons @@ -144,6 +144,8 @@ development libraries for ctdb %{_libdir}/libctdb.a %changelog +* Wed Feb 20 2013 : version 1.2.39-8 + - Don't send "ipreallocate" events to stopped nodes * Fri Nov 30 2012 : version 1.2.39-7 - Do not ignore timed out monitor events - Track the nodes that fail takeover run and set culprit count diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c index e17b481..1e8dc75 100644 --- a/server/ctdb_takeover.c +++ b/server/ctdb_takeover.c @@ -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, -- CTDB repository