The branch, master has been updated
via 56d9c8b222436814fa39bc583318e6fd8e6c74c3 (commit)
via 9395a05de669c69396e701fb36409ec49d3ebef6 (commit)
from 8e894d8baf20a455b50c5c1b1ac0540d9e766c5d (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 56d9c8b222436814fa39bc583318e6fd8e6c74c3
Author: Ronnie Sahlberg <[EMAIL PROTECTED]>
Date: Thu Apr 24 22:06:04 2008 +1000
update version to .34
commit 9395a05de669c69396e701fb36409ec49d3ebef6
Author: Ronnie Sahlberg <[EMAIL PROTECTED]>
Date: Thu Apr 24 21:51:08 2008 +1000
when deleting a public ip from a node that is currently hosting this ip,
try to move the ip address to a different node first
-----------------------------------------------------------------------
Summary of changes:
packaging/RPM/ctdb.spec | 12 ++++++-
tools/ctdb.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 94 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 6974739..890251f 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -5,7 +5,7 @@ Vendor: Samba Team
Packager: Samba Team <[EMAIL PROTECTED]>
Name: ctdb
Version: 1.0
-Release: 33
+Release: 34
Epoch: 0
License: GNU GPL version 3
Group: System Environment/Daemons
@@ -120,6 +120,16 @@ fi
%{_includedir}/ctdb_private.h
%changelog
+* Thu Apr 24 2008 : Version 1.0.34
+ - When deleting a public ip from a node, try to migrate the ip to a different
+ node first.
+ - Change catdb to produce output similar to tdbdump
+ - When adding a new public ip address, if this ip does not exist yet in
+ the cluster, then grab the ip on the local node and activate it.
+ - When a node disagrees with the recmaster on WHO is the recmaster, then
+ mark that node as a recovery culprit so it will eventually become
+ banned.
+ - Make ctdb eventscript support the -n all argument.
* Thu Apr 10 2008 : Version 1.0.33
- Add facilities to include site local adaptations to the eventscript
by /etc/ctdb/rc.local which will be read by all eventscripts.
diff --git a/tools/ctdb.c b/tools/ctdb.c
index 6e94417..2af9a15 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -609,6 +609,53 @@ control_get_all_public_ips(struct ctdb_context *ctdb,
TALLOC_CTX *tmp_ctx, struc
}
+/*
+ * scans all other nodes and returns a pnn for another node that can host this
+ * ip address or -1
+ */
+static int
+find_other_host_for_public_ip(struct ctdb_context *ctdb, struct sockaddr_in
*addr)
+{
+ TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
+ struct ctdb_all_public_ips *ips;
+ struct ctdb_node_map *nodemap=NULL;
+ int i, j, ret;
+
+ ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE,
tmp_ctx, &nodemap);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get nodemap from node %u\n",
options.pnn));
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
+ for(i=0;i<nodemap->num;i++){
+ if (nodemap->nodes[i].flags & NODE_FLAGS_DISCONNECTED) {
+ continue;
+ }
+ if (nodemap->nodes[i].pnn == options.pnn) {
+ continue;
+ }
+
+ /* read the public ip list from this node */
+ ret = ctdb_ctrl_get_public_ips(ctdb, TIMELIMIT(),
nodemap->nodes[i].pnn, tmp_ctx, &ips);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get public ip list from
node %u\n", nodemap->nodes[i].pnn));
+ return -1;
+ }
+
+ for (j=0;j<ips->num;j++) {
+ if (ctdb_same_ip(addr, &ips->ips[j].sin)) {
+ talloc_free(tmp_ctx);
+ return nodemap->nodes[i].pnn;
+ }
+ }
+ talloc_free(ips);
+ }
+
+ talloc_free(tmp_ctx);
+ return -1;
+}
+
/*
add a public ip address to a node
*/
@@ -687,11 +734,14 @@ static int control_addip(struct ctdb_context *ctdb, int
argc, const char **argv)
*/
static int control_delip(struct ctdb_context *ctdb, int argc, const char
**argv)
{
- int ret;
+ int i, ret;
struct sockaddr_in addr;
struct ctdb_control_ip_iface pub;
+ TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
+ struct ctdb_all_public_ips *ips;
if (argc != 1) {
+ talloc_free(tmp_ctx);
usage();
}
@@ -705,12 +755,44 @@ static int control_delip(struct ctdb_context *ctdb, int
argc, const char **argv)
pub.mask = 0;
pub.len = 0;
+ ret = ctdb_ctrl_get_public_ips(ctdb, TIMELIMIT(), options.pnn, tmp_ctx,
&ips);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Unable to get public ip list from
cluster\n"));
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
+ for (i=0;i<ips->num;i++) {
+ if (ctdb_same_ip(&addr, &ips->ips[i].sin)) {
+ break;
+ }
+ }
+
+ if (i==ips->num) {
+ DEBUG(DEBUG_ERR, ("This node does not support this public
address '%s'\n",
+ inet_ntoa(addr.sin_addr)));
+ talloc_free(tmp_ctx);
+ return -1;
+ }
+
+ if (ips->ips[i].pnn == options.pnn) {
+ ret = find_other_host_for_public_ip(ctdb, &addr);
+ if (ret != -1) {
+ ret = control_send_release(ctdb, ret, &addr);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR, ("Failed to migrate this ip to
another node. Use moveip of recover to reassign this address to a node\n"));
+ }
+ }
+ }
+
ret = ctdb_ctrl_del_public_ip(ctdb, TIMELIMIT(), options.pnn, &pub);
if (ret != 0) {
DEBUG(DEBUG_ERR, ("Unable to del public ip from node %u\n",
options.pnn));
+ talloc_free(tmp_ctx);
return ret;
}
+ talloc_free(tmp_ctx);
return 0;
}
--
CTDB repository