From 001adec10df0ab80b1c73836602524725bb3c3e1 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 15 Aug 2016 15:58:19 +1000 Subject: [PATCH 1/2] ctdb-tools: Drop "ctdb rebalanceip" BUG: https://bugzilla.samba.org/show_bug.cgi?id=12151 This was already dropped in commit aaa57fbcb392061f8fbb5a12fd0e6a7be934ab66. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit f376f346f25f12b63a11e10d097282c364c1a514) --- ctdb/tools/ctdb.c | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index efa0f02..6264afa 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -3830,59 +3830,6 @@ static int control_moveip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return 0; } -static int control_rebalanceip(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, - int argc, const char **argv) -{ - ctdb_sock_addr addr; - struct ctdb_node_map *nodemap; - struct ctdb_public_ip pubip; - struct ctdb_req_control request; - uint32_t *pnn_list; - int ret, count; - - if (argc != 1) { - usage("rebalanceip"); - } - - if (parse_ip(argv[0], NULL, 0, &addr)) { - fprintf(stderr, "Invalid IP address %s\n", argv[0]); - return 1; - } - - ret = ctdb_message_disable_ip_check(mem_ctx, ctdb->ev, ctdb->client, - CTDB_BROADCAST_CONNECTED, - 2*options.timelimit); - if (ret != 0) { - fprintf(stderr, "Failed to disable IP check\n"); - return 1; - } - - nodemap = get_nodemap(ctdb, false); - if (nodemap == NULL) { - return 1; - } - - count = list_of_active_nodes(nodemap, -1, mem_ctx, &pnn_list); - if (count <= 0) { - fprintf(stderr, "Memory allocation error\n"); - return 1; - } - - pubip.pnn = CTDB_UNKNOWN_PNN; - pubip.addr = addr; - - ctdb_req_control_release_ip(&request, &pubip); - ret = ctdb_client_control_multi(mem_ctx, ctdb->ev, ctdb->client, - pnn_list, count, TIMEOUT(), - &request, NULL, NULL); - if (ret != 0) { - fprintf(stderr, "Failed to release IP from nodes\n"); - return 1; - } - - return ipreallocate(mem_ctx, ctdb); -} - static int rebalancenode(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, uint32_t pnn) { @@ -6285,8 +6232,6 @@ static const struct ctdb_cmd { "reload the nodes file all nodes", NULL }, { "moveip", control_moveip, false, false, "move an ip address to another node", " " }, - { "rebalanceip", control_rebalanceip, false, false, - "move an ip address optimally to another node", "" }, { "addip", control_addip, false, true, "add an ip address to a node", " " }, { "delip", control_delip, false, true, -- 2.7.4 From bcb128d24eb0dd21e78878fde6672e5a9cf2751b Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 15 Aug 2016 15:58:58 +1000 Subject: [PATCH 2/2] ctdb-tools: Drop "ctdb rebalancenode" BUG: https://bugzilla.samba.org/show_bug.cgi?id=12151 This was already dropped in commit d67868469521341aa92c589a0bb6df90b150d555. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Aug 17 09:22:13 CEST 2016 on sn-devel-144 (cherry picked from commit 47e6c37dca674f54992ffffb1c9895230c4c9e90) --- ctdb/tools/ctdb.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 6264afa..4191fc5 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -5731,22 +5731,6 @@ static int control_checktcpport(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return 0; } -static int control_rebalancenode(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, - int argc, const char **argv) -{ - if (argc != 0) { - usage("rebalancenode"); - } - - if (! rebalancenode(mem_ctx, ctdb, ctdb->cmd_pnn)) { - fprintf(stderr, "Failed to rebalance IPs on node %u\n", - ctdb->cmd_pnn); - return 1; - } - - return 0; -} - static int control_getdbseqnum(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, int argc, const char **argv) { @@ -6289,8 +6273,6 @@ static const struct ctdb_cmd { "delete a database key", " " }, { "checktcpport", control_checktcpport, true, false, "check if a service is bound to a specific tcp port or not", "" }, - { "rebalancenode", control_rebalancenode, false, true, - "mark nodes as forced IP rebalancing targets", NULL }, { "getdbseqnum", control_getdbseqnum, false, false, "get database sequence number", "" }, { "nodestatus", control_nodestatus, false, true, -- 2.7.4