mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
repmgr: during switchover, correctly detect unclean shutdown status
This commit is contained in:
25
dbutils.c
25
dbutils.c
@@ -4657,12 +4657,13 @@ bdr_node_set_repmgr_set(PGconn *conn, const char *node_name)
|
||||
" SELECT bdr.connection_set_replication_sets( "
|
||||
" ARRAY( "
|
||||
" SELECT repset::TEXT "
|
||||
" FROM UNNEST(bdr.connection_get_replication_sets('node1')) AS repset "
|
||||
" FROM UNNEST(bdr.connection_get_replication_sets('%s')) AS repset "
|
||||
" UNION "
|
||||
" SELECT 'repmgr'::TEXT "
|
||||
" ), "
|
||||
" '%s' "
|
||||
" ) ",
|
||||
node_name,
|
||||
node_name);
|
||||
|
||||
res = PQexec(conn, query.data);
|
||||
@@ -4677,3 +4678,25 @@ bdr_node_set_repmgr_set(PGconn *conn, const char *node_name)
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* miscellaneous debugging functions */
|
||||
|
||||
const char *
|
||||
print_node_status(NodeStatus node_status)
|
||||
{
|
||||
switch (node_status)
|
||||
{
|
||||
case NODE_STATUS_UNKNOWN:
|
||||
return "UNKNOWN";
|
||||
case NODE_STATUS_UP:
|
||||
return "UP";
|
||||
case NODE_STATUS_DOWN:
|
||||
return "DOWN";
|
||||
case NODE_STATUS_UNCLEAN_SHUTDOWN:
|
||||
return "UNCLEAN_SHUTDOWN";
|
||||
}
|
||||
|
||||
return "UNIDENTIFIED_STATUS";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user