1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2020-08-07 12:19:09 +10:00 committed by Amitay Isaacs
parent e89ec78e9a
commit 971c20e9dc
3 changed files with 1 additions and 58 deletions

View 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
-->

View File

@ -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

View 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,