add a new serverid to send a message everytime an ip address is taken on the local...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 13 Sep 2010 05:42:00 +0000 (15:42 +1000)
committerMichael Adam <obnox@samba.org>
Fri, 6 Jun 2014 13:00:37 +0000 (15:00 +0200)
(cherry picked from commit 1261f3d9702800a4e59550c881350daf479f00ef)

Conflicts:

include/ctdb_protocol.h

include/ctdb.h
server/ctdb_takeover.c

index 9aa03b76b5d3007c93b131ad292ff2abcf1d0c31..af33deeb6b1c775c589060fb3d685112029dd8b5 100644 (file)
@@ -71,6 +71,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
  */
index 650da207da05f67a9c5e8f13a8aa99601d120d84..75f0d71647669d3fcbf5c4066e2d7604088b2dbc 100644 (file)
@@ -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);