From: Martin Schwenke Date: Sun, 10 Apr 2016 22:02:36 +0000 (+1000) Subject: ctdb-daemon: Drop --single-public-ip option and related code X-Git-Tag: talloc-2.1.7~243 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=951e8180a9857484cd30ac03b4b2d9761c91ec99;p=thirdparty%2Fsamba.git ctdb-daemon: Drop --single-public-ip option and related code This has been replaced by scripts. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/doc/ctdbd.1.xml b/ctdb/doc/ctdbd.1.xml index ae61792bcfd..cf792135cce 100644 --- a/ctdb/doc/ctdbd.1.xml +++ b/ctdb/doc/ctdbd.1.xml @@ -367,8 +367,7 @@ --public-interface=INTERFACE - INTERFACE on which to attach public IP addresses or on which - to attach the single-public-ip when used. + Default INTERFACE on which to attach public IP addresses. When using public IP addresses, this is only required if @@ -395,22 +394,6 @@ - - --single-public-ip=IPADDR - - - IPADDR specifies the single IP that CTDB will use in - conjunction with LVS. - - - Please see the LVS section in - ctdb - 7 for more - information. - - - - --start-as-disabled diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index bf45246c548..b17af53e744 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -318,7 +318,6 @@ struct ctdb_context { struct reqid_context *idr; struct ctdb_node **nodes; /* array of nodes in the cluster - indexed by vnn */ struct ctdb_vnn *vnn; /* list of public ip addresses and interfaces */ - struct ctdb_vnn *single_ip_vnn; /* a structure for the single ip */ struct ctdb_interface *ifaces; /* list of local interfaces */ char *err_msg; const struct ctdb_methods *methods; /* transport methods */ @@ -977,8 +976,6 @@ int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb, bool *async_reply); int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses); -int ctdb_set_single_public_ip(struct ctdb_context *ctdb, const char *iface, - const char *ip); int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap, uint32_t *force_rebalance_nodes, diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index d8f09ddb2fb..88656f97444 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -114,10 +114,9 @@ static bool vnn_has_interface_with_name(struct ctdb_vnn *vnn, * foolproof. One alternative is reference counting, where the logic * is distributed and can, therefore, be broken in multiple places. * Another alternative is to build a red-black tree of interfaces that - * can have addresses (by walking ctdb->vnn and ctdb->single_ip_vnn - * once) and then walking ctdb->ifaces once and deleting those not in - * the tree. Let's go to one of those if the naive implementation - * causes problems... :-) + * can have addresses (by walking ctdb->vnn once) and then walking + * ctdb->ifaces once and deleting those not in the tree. Let's go to + * one of those if the naive implementation causes problems... :-) */ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb, struct ctdb_vnn *vnn) @@ -135,13 +134,6 @@ static void ctdb_remove_orphaned_ifaces(struct ctdb_context *ctdb, continue; } - /* Is the "single IP" on this interface? */ - if ((ctdb->single_ip_vnn != NULL) && - (ctdb->single_ip_vnn->ifaces[0] != NULL) && - (strcmp(i->name, ctdb->single_ip_vnn->ifaces[0]) == 0)) { - /* Found, next interface please... */ - continue; - } /* Search for a vnn with this interface. */ found = false; for (tv=ctdb->vnn; tv; tv=tv->next) { @@ -1140,58 +1132,6 @@ int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses) return 0; } -int ctdb_set_single_public_ip(struct ctdb_context *ctdb, - const char *iface, - const char *ip) -{ - struct ctdb_vnn *svnn; - struct ctdb_interface *cur = NULL; - bool ok; - int ret; - - svnn = talloc_zero(ctdb, struct ctdb_vnn); - CTDB_NO_MEMORY(ctdb, svnn); - - svnn->ifaces = talloc_array(svnn, const char *, 2); - CTDB_NO_MEMORY(ctdb, svnn->ifaces); - svnn->ifaces[0] = talloc_strdup(svnn->ifaces, iface); - CTDB_NO_MEMORY(ctdb, svnn->ifaces[0]); - svnn->ifaces[1] = NULL; - - ok = parse_ip(ip, iface, 0, &svnn->public_address); - if (!ok) { - talloc_free(svnn); - return -1; - } - - ret = ctdb_add_local_iface(ctdb, svnn->ifaces[0]); - if (ret != 0) { - DEBUG(DEBUG_CRIT, (__location__ " failed to add iface[%s] " - "for single_ip[%s]\n", - svnn->ifaces[0], - ctdb_addr_to_str(&svnn->public_address))); - talloc_free(svnn); - return -1; - } - - /* assume the single public ip interface is initially "good" */ - cur = ctdb_find_iface(ctdb, iface); - if (cur == NULL) { - DEBUG(DEBUG_CRIT,("Can not find public interface %s used by --single-public-ip", iface)); - return -1; - } - cur->link_up = true; - - ret = ctdb_vnn_assign_iface(ctdb, svnn); - if (ret != 0) { - talloc_free(svnn); - return -1; - } - - ctdb->single_ip_vnn = svnn; - return 0; -} - static void *add_ip_callback(void *parm, void *data) { struct public_ip_list *this_ip = parm; @@ -2474,14 +2414,6 @@ int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb, addr = (ctdb_sock_addr *)indata.dptr; vnn = find_public_ip_vnn(ctdb, addr); - if (vnn == NULL) { - /* if it is not a public ip it could be our 'single ip' */ - if (ctdb->single_ip_vnn) { - if (ctdb_same_ip(&ctdb->single_ip_vnn->public_address, addr)) { - vnn = ctdb->single_ip_vnn; - } - } - } if (vnn == NULL) { DEBUG(DEBUG_ERR,(__location__ " Could not get public ip info, " "'%s'not a public address\n", diff --git a/ctdb/server/ctdbd.c b/ctdb/server/ctdbd.c index b8b979d922b..1565eae6059 100644 --- a/ctdb/server/ctdbd.c +++ b/ctdb/server/ctdbd.c @@ -53,7 +53,6 @@ static struct { const char *db_dir_persistent; const char *db_dir_state; const char *public_interface; - const char *single_public_ip; int valgrinding; int nosetsched; int start_as_disabled; @@ -122,7 +121,6 @@ int main(int argc, const char *argv[]) { "interactive", 'i', POPT_ARG_NONE, &interactive, 0, "don't fork", NULL }, { "public-addresses", 0, POPT_ARG_STRING, &options.public_address_list, 0, "public address list file", "filename" }, { "public-interface", 0, POPT_ARG_STRING, &options.public_interface, 0, "public interface", "interface"}, - { "single-public-ip", 0, POPT_ARG_STRING, &options.single_public_ip, 0, "single public ip", "ip-address"}, { "event-script-dir", 0, POPT_ARG_STRING, &options.event_script_dir, 0, "event script directory", "dirname" }, { "logging", 0, POPT_ARG_STRING, &options.logging, 0, "logging method to be used", NULL }, { "nlist", 0, POPT_ARG_STRING, &options.nlist, 0, "node list file", "filename" }, @@ -282,20 +280,6 @@ int main(int argc, const char *argv[]) CTDB_NO_MEMORY(ctdb, ctdb->default_public_interface); } - if (options.single_public_ip) { - if (options.public_interface == NULL) { - DEBUG(DEBUG_ALERT,("--single_public_ip used but --public_interface is not specified. You must specify the public interface when using single public ip. Exiting\n")); - exit(10); - } - - ret = ctdb_set_single_public_ip(ctdb, options.public_interface, - options.single_public_ip); - if (ret != 0) { - DEBUG(DEBUG_ALERT,("Invalid --single-public-ip argument : %s . This is not a valid ip address. Exiting.\n", options.single_public_ip)); - exit(10); - } - } - if (options.event_script_dir != NULL) { ctdb->event_script_dir = options.event_script_dir; } else {