[SCM] CTDB repository - branch 1.2 updated - ctdb-1.0.114-330-g478e3d2

Ronnie Sahlberg sahlberg at samba.org
Sun Sep 12 23:42:02 MDT 2010


The branch, 1.2 has been updated
       via  478e3d29f2682f7f3ac684eaaa4aafd61da1358b (commit)
      from  574be1e4bd15beeb5ab7d6d248fa0ccb9c3456f8 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2


- Log -----------------------------------------------------------------
commit 478e3d29f2682f7f3ac684eaaa4aafd61da1358b
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Sep 13 15:42:00 2010 +1000

    add a new serverid to send a message everytime an ip address is taken on the local node

-----------------------------------------------------------------------

Summary of changes:
 include/ctdb_protocol.h |    5 +++++
 server/ctdb_takeover.c  |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/include/ctdb_protocol.h b/include/ctdb_protocol.h
index 4cd3fca..a9f6249 100644
--- a/include/ctdb_protocol.h
+++ b/include/ctdb_protocol.h
@@ -85,6 +85,11 @@ struct ctdb_call_info {
 #define CTDB_SRVID_RELEASE_IP 0xF300000000000000LL
 
 /*
+   a message handler ID meaning that an IP address has been taken
+ */
+#define CTDB_SRVID_TAKE_IP 0xF301000000000000LL
+
+/*
    a message ID to set the node flags in the recovery daemon
  */
 #define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index 1931294..d7fb5ad 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -331,6 +331,7 @@ static void ctdb_do_takeip_callback(struct ctdb_context *ctdb, int status,
 	struct ctdb_do_takeip_state *state =
 		talloc_get_type(private_data, struct ctdb_do_takeip_state);
 	int32_t ret;
+	TDB_DATA data;
 
 	if (status != 0) {
 		if (status == -ETIME) {
@@ -351,6 +352,13 @@ static void ctdb_do_takeip_callback(struct ctdb_context *ctdb, int status,
 		return;
 	}
 
+	data.dptr  = (uint8_t *)ctdb_addr_to_str(&state->vnn->public_address);
+	data.dsize = strlen((char *)data.dptr) + 1;
+	DEBUG(DEBUG_INFO,(__location__ " sending TAKE_IP for '%s'\n", data.dptr));
+
+	ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_TAKE_IP, data);
+
+
 	/* the control succeeded */
 	ctdb_request_control_reply(ctdb, state->c, NULL, 0, NULL);
 	talloc_free(state);


-- 
CTDB repository


More information about the samba-cvs mailing list