ctdb-tools: Drop "ctdb isnotrecmaster" command
authorMartin Schwenke <martin@meltin.net>
Fri, 7 Aug 2020 02:19:09 +0000 (12:19 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 17 Aug 2020 04:51:32 +0000 (04:51 +0000)
This isn't used anywhere and can easily be checked via "ctdb pnn" and
"ctdb recmaster" commands.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/doc/ctdb.1.xml
ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh [deleted file]
ctdb/tools/ctdb.c

index 217a6d3e41aed834d2e46ee60e03ab3fd082469e..e0e05d8e542819567f9e30c0f5d782e90cf325ae 100644 (file)
@@ -1816,7 +1816,7 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/li
   </refsect1>
 
   <!-- UNDOCUMENTED: stats
-       isnotrecmaster addtickle deltickle
+       addtickle deltickle
        tfetch tstore readkey writekey
        checktcpport getdbseqnum
   -->
diff --git a/ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh b/ctdb/tests/INTEGRATION/simple/cluster.001.isnotrecmaster.sh
deleted file mode 100755 (executable)
index 7d8620b..0000000
+++ /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
index 5209081f3227450dd86d8259fe236787cd25778e..e21d2d4b562c6ac96d317e562e274a8444ac2054 100644 (file)
@@ -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", "<ip> <interface>" },
        { "tickle", control_tickle, true, false,