From: Martin Schwenke Date: Fri, 7 Aug 2020 02:19:09 +0000 (+1000) Subject: ctdb-tools: Drop "ctdb isnotrecmaster" command X-Git-Tag: talloc-2.3.2~870 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=971c20e9dc264c076b3fdfbeda71e4430919e7e4;p=thirdparty%2Fsamba.git ctdb-tools: Drop "ctdb isnotrecmaster" command This isn't used anywhere and can easily be checked via "ctdb pnn" and "ctdb recmaster" commands. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml index 217a6d3e41a..e0e05d8e542 100644 --- a/ctdb/doc/ctdb.1.xml +++ b/ctdb/doc/ctdb.1.xml @@ -1816,7 +1816,7 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/li diff --git a/ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh b/ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh deleted file mode 100755 index 7d8620bc2f5..00000000000 --- a/ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Verify the operation of 'ctdb isnotrecmaster' - -. "${TEST_SCRIPTS_DIR}/integration.bash" - -set -e - -ctdb_test_init - -cmd="$CTDB isnotrecmaster || true" -try_command_on_node -v all "$cmd" - -num_all_lines=$(wc -l <"$outfile") -num_rm_lines=$(grep -Fc 'this node is the recmaster' "$outfile") || true -num_not_rm_lines=$(grep -Fc 'this node is not the recmaster' "$outfile") || true - -if [ $num_rm_lines -eq 1 ] ; then - echo "OK, there is only 1 recmaster" -else - die "BAD, there are ${num_rm_lines} nodes claiming to be the recmaster" -fi - -if [ $(($num_all_lines - $num_not_rm_lines)) -eq 1 ] ; then - echo "OK, all the other nodes claim not to be the recmaster" -else - die "BAD, there are only ${num_not_rm_lines} notrecmaster nodes" -fi diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 5209081f322..e21d2d4b562 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -2997,33 +2997,6 @@ static int control_ipreallocate(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, return ipreallocate(mem_ctx, ctdb); } -static int control_isnotrecmaster(TALLOC_CTX *mem_ctx, - struct ctdb_context *ctdb, - int argc, const char **argv) -{ - uint32_t recmaster; - int ret; - - if (argc != 0) { - usage("isnotrecmaster"); - } - - ret = ctdb_ctrl_get_recmaster(mem_ctx, ctdb->ev, ctdb->client, - ctdb->pnn, TIMEOUT(), &recmaster); - if (ret != 0) { - fprintf(stderr, "Failed to get recmaster\n"); - return ret; - } - - if (recmaster != ctdb->pnn) { - printf("this node is not the recmaster\n"); - return 1; - } - - printf("this node is the recmaster\n"); - return 0; -} - static int control_gratarp(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb, int argc, const char **argv) { @@ -5990,8 +5963,6 @@ static const struct ctdb_cmd { "run ip reallocation (deprecated)", NULL }, { "ipreallocate", control_ipreallocate, false, true, "run ip reallocation", NULL }, - { "isnotrecmaster", control_isnotrecmaster, false, false, - "check if local node is the recmaster", NULL }, { "gratarp", control_gratarp, false, true, "send a gratuitous arp", " " }, { "tickle", control_tickle, true, false,