From cb3db024eff63bb4d6c1a60a6adc93f9e85d701a Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Thu, 21 Apr 2016 15:20:05 +1000 Subject: [PATCH] ctdb-tool: Remove commands related to server_id Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- ctdb/doc/ctdb.1.xml | 4 +- ctdb/tools/ctdb.c | 109 -------------------------------------------- 2 files changed, 2 insertions(+), 111 deletions(-) diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 7cab96f52ff..7c3b5519935 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -1724,8 +1724,8 @@ Server id 0:14765 exists diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 7305aa4be54..491cbfca961 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -2304,111 +2304,6 @@ static int control_gratious_arp(struct ctdb_context *ctdb, int argc, const char return 0; } -/* - register a server id - */ -static int regsrvid(struct ctdb_context *ctdb, int argc, const char **argv) -{ - int ret; - struct ctdb_client_id server_id; - - if (argc < 3) { - usage(); - } - - server_id.pnn = strtoul(argv[0], NULL, 0); - server_id.type = strtoul(argv[1], NULL, 0); - server_id.server_id = strtoul(argv[2], NULL, 0); - - ret = ctdb_ctrl_register_server_id(ctdb, TIMELIMIT(), &server_id); - if (ret != 0) { - DEBUG(DEBUG_ERR, ("Unable to register server_id from node %u\n", options.pnn)); - return ret; - } - DEBUG(DEBUG_ERR,("Srvid registered. Sleeping for 999 seconds\n")); - sleep(999); - return -1; -} - -/* - unregister a server id - */ -static int unregsrvid(struct ctdb_context *ctdb, int argc, const char **argv) -{ - int ret; - struct ctdb_client_id server_id; - - if (argc < 3) { - usage(); - } - - server_id.pnn = strtoul(argv[0], NULL, 0); - server_id.type = strtoul(argv[1], NULL, 0); - server_id.server_id = strtoul(argv[2], NULL, 0); - - ret = ctdb_ctrl_unregister_server_id(ctdb, TIMELIMIT(), &server_id); - if (ret != 0) { - DEBUG(DEBUG_ERR, ("Unable to unregister server_id from node %u\n", options.pnn)); - return ret; - } - return -1; -} - -/* - check if a server id exists - */ -static int chksrvid(struct ctdb_context *ctdb, int argc, const char **argv) -{ - uint32_t status = 0; - int ret; - struct ctdb_client_id server_id; - - if (argc < 3) { - usage(); - } - - server_id.pnn = strtoul(argv[0], NULL, 0); - server_id.type = strtoul(argv[1], NULL, 0); - server_id.server_id = strtoul(argv[2], NULL, 0); - - ret = ctdb_ctrl_check_server_id(ctdb, TIMELIMIT(), options.pnn, &server_id, &status); - if (ret != 0) { - DEBUG(DEBUG_ERR, ("Unable to check server_id from node %u\n", options.pnn)); - return ret; - } - - if (status) { - printf("Server id %d:%d:%d EXISTS\n", server_id.pnn, server_id.type, server_id.server_id); - } else { - printf("Server id %d:%d:%d does NOT exist\n", server_id.pnn, server_id.type, server_id.server_id); - } - return 0; -} - -/* - get a list of all server ids that are registered on a node - */ -static int getsrvids(struct ctdb_context *ctdb, int argc, const char **argv) -{ - int i, ret; - struct ctdb_client_id_list_old *server_ids; - - ret = ctdb_ctrl_get_server_id_list(ctdb, ctdb, TIMELIMIT(), options.pnn, &server_ids); - if (ret != 0) { - DEBUG(DEBUG_ERR, ("Unable to get server_id list from node %u\n", options.pnn)); - return ret; - } - - for (i=0; inum; i++) { - printf("Server id %d:%d:%d\n", - server_ids->server_ids[i].pnn, - server_ids->server_ids[i].type, - server_ids->server_ids[i].server_id); - } - - return -1; -} - /* check if a server id exists */ @@ -5931,10 +5826,6 @@ static const struct { { "deltickle", control_del_tickle, false, false, "delete a tickle from this ip", ": :" }, - { "regsrvid", regsrvid, false, false, "register a server id", " " }, - { "unregsrvid", unregsrvid, false, false, "unregister a server id", " " }, - { "chksrvid", chksrvid, false, false, "check if a server id exists", " " }, - { "getsrvids", getsrvids, false, false, "get a list of all server ids"}, { "check_srvids", check_srvids, false, false, "check if a srvid exists", "+" }, { "listnodes", control_listnodes, false, true, "list all nodes in the cluster"}, { "reloadnodes", control_reload_nodes_file, false, false, "reload the nodes file and restart the transport on all nodes"}, -- 2.47.3