mirror of
https://github.com/samba-team/samba.git
synced 2025-01-07 17:18:11 +03:00
ctdb-tools: Print "UNKNOWN" when leader PNN is unknown
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
01a8d1a4a4
commit
ec90f36cc6
@ -213,6 +213,16 @@ failed:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void print_pnn(uint32_t pnn)
|
||||||
|
{
|
||||||
|
if (pnn == CTDB_UNKNOWN_PNN) {
|
||||||
|
printf("UNKNOWN\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%u\n", pnn);
|
||||||
|
}
|
||||||
|
|
||||||
static bool verify_pnn(struct ctdb_context *ctdb, int pnn)
|
static bool verify_pnn(struct ctdb_context *ctdb, int pnn)
|
||||||
{
|
{
|
||||||
struct ctdb_node_map *nodemap;
|
struct ctdb_node_map *nodemap;
|
||||||
@ -862,7 +872,8 @@ static void print_status(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
|
|||||||
printf("Recovery mode:%s (%d)\n",
|
printf("Recovery mode:%s (%d)\n",
|
||||||
recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "RECOVERY",
|
recmode == CTDB_RECOVERY_NORMAL ? "NORMAL" : "RECOVERY",
|
||||||
recmode);
|
recmode);
|
||||||
printf("Recovery master:%d\n", recmaster);
|
printf("Recovery master:");
|
||||||
|
print_pnn(recmaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int control_status(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
|
static int control_status(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
|
||||||
@ -4536,7 +4547,8 @@ static int control_recmaster(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%u\n", recmaster);
|
print_pnn(recmaster);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user