mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
Rename enum types for consistency
This commit is contained in:
@@ -854,11 +854,11 @@ get_server_version(PGconn *conn, char *server_version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
t_recovery_type
|
RecoveryType
|
||||||
get_recovery_type(PGconn *conn)
|
get_recovery_type(PGconn *conn)
|
||||||
{
|
{
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
t_recovery_type recovery_type = RECTYPE_MASTER;
|
RecoveryType recovery_type = RECTYPE_MASTER;
|
||||||
|
|
||||||
char *sqlquery = "SELECT pg_catalog.pg_is_in_recovery()";
|
char *sqlquery = "SELECT pg_catalog.pg_is_in_recovery()";
|
||||||
|
|
||||||
@@ -946,7 +946,7 @@ _get_master_connection(PGconn *conn,
|
|||||||
|
|
||||||
for (i = 0; i < PQntuples(res); i++)
|
for (i = 0; i < PQntuples(res); i++)
|
||||||
{
|
{
|
||||||
t_recovery_type recovery_type;
|
RecoveryType recovery_type;
|
||||||
|
|
||||||
/* initialize with the values of the current node being processed */
|
/* initialize with the values of the current node being processed */
|
||||||
node_id = atoi(PQgetvalue(res, i, 0));
|
node_id = atoi(PQgetvalue(res, i, 0));
|
||||||
@@ -1079,7 +1079,7 @@ bool atobool(const char *value)
|
|||||||
/* extension functions */
|
/* extension functions */
|
||||||
/* =================== */
|
/* =================== */
|
||||||
|
|
||||||
t_extension_status
|
ExtensionStatus
|
||||||
get_repmgr_extension_status(PGconn *conn)
|
get_repmgr_extension_status(PGconn *conn)
|
||||||
{
|
{
|
||||||
PQExpBufferData query;
|
PQExpBufferData query;
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ typedef enum {
|
|||||||
REPMGR_AVAILABLE,
|
REPMGR_AVAILABLE,
|
||||||
REPMGR_UNAVAILABLE,
|
REPMGR_UNAVAILABLE,
|
||||||
REPMGR_UNKNOWN
|
REPMGR_UNKNOWN
|
||||||
} t_extension_status;
|
} ExtensionStatus;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RECTYPE_UNKNOWN = 0,
|
RECTYPE_UNKNOWN = 0,
|
||||||
RECTYPE_MASTER,
|
RECTYPE_MASTER,
|
||||||
RECTYPE_STANDBY
|
RECTYPE_STANDBY
|
||||||
} t_recovery_type;
|
} RecoveryType;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
RECORD_ERROR = -1,
|
RECORD_ERROR = -1,
|
||||||
@@ -188,11 +188,11 @@ bool get_pg_setting(PGconn *conn, const char *setting, char *output);
|
|||||||
/* server information functions */
|
/* server information functions */
|
||||||
bool get_cluster_size(PGconn *conn, char *size);
|
bool get_cluster_size(PGconn *conn, char *size);
|
||||||
int get_server_version(PGconn *conn, char *server_version);
|
int get_server_version(PGconn *conn, char *server_version);
|
||||||
t_recovery_type get_recovery_type(PGconn *conn);
|
RecoveryType get_recovery_type(PGconn *conn);
|
||||||
int get_master_node_id(PGconn *conn);
|
int get_master_node_id(PGconn *conn);
|
||||||
|
|
||||||
/* extension functions */
|
/* extension functions */
|
||||||
t_extension_status get_repmgr_extension_status(PGconn *conn);
|
ExtensionStatus get_repmgr_extension_status(PGconn *conn);
|
||||||
|
|
||||||
/* result functions */
|
/* result functions */
|
||||||
bool atobool(const char *value);
|
bool atobool(const char *value);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ do_master_register(void)
|
|||||||
PGconn *conn = NULL;
|
PGconn *conn = NULL;
|
||||||
PGconn *master_conn = NULL;
|
PGconn *master_conn = NULL;
|
||||||
int current_master_id = UNKNOWN_NODE_ID;
|
int current_master_id = UNKNOWN_NODE_ID;
|
||||||
t_recovery_type recovery_type;
|
RecoveryType recovery_type;
|
||||||
t_node_info node_info = T_NODE_INFO_INITIALIZER;
|
t_node_info node_info = T_NODE_INFO_INITIALIZER;
|
||||||
RecordStatus record_status;
|
RecordStatus record_status;
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ do_master_unregister(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
bool can_unregister = true;
|
bool can_unregister = true;
|
||||||
t_recovery_type recovery_type = get_recovery_type(target_node_conn);
|
RecoveryType recovery_type = get_recovery_type(target_node_conn);
|
||||||
|
|
||||||
/* Node appears to be a standby */
|
/* Node appears to be a standby */
|
||||||
if (recovery_type == RECTYPE_STANDBY)
|
if (recovery_type == RECTYPE_STANDBY)
|
||||||
|
|||||||
@@ -1042,7 +1042,7 @@ do_standby_promote(void)
|
|||||||
|
|
||||||
char script[MAXLEN];
|
char script[MAXLEN];
|
||||||
|
|
||||||
t_recovery_type recovery_type;
|
RecoveryType recovery_type;
|
||||||
int r;
|
int r;
|
||||||
char data_dir[MAXLEN];
|
char data_dir[MAXLEN];
|
||||||
|
|
||||||
@@ -1584,7 +1584,7 @@ check_source_server()
|
|||||||
char cluster_size[MAXLEN];
|
char cluster_size[MAXLEN];
|
||||||
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
||||||
RecordStatus record_status;
|
RecordStatus record_status;
|
||||||
t_extension_status extension_status;
|
ExtensionStatus extension_status;
|
||||||
|
|
||||||
/* Attempt to connect to the upstream server to verify its configuration */
|
/* Attempt to connect to the upstream server to verify its configuration */
|
||||||
log_info(_("connecting to upstream node"));
|
log_info(_("connecting to upstream node"));
|
||||||
@@ -2993,7 +2993,7 @@ check_master_standby_version_match(PGconn *conn, PGconn *master_conn)
|
|||||||
static void
|
static void
|
||||||
check_recovery_type(PGconn *conn)
|
check_recovery_type(PGconn *conn)
|
||||||
{
|
{
|
||||||
t_recovery_type recovery_type = get_recovery_type(conn);
|
RecoveryType recovery_type = get_recovery_type(conn);
|
||||||
|
|
||||||
if (recovery_type != RECTYPE_STANDBY)
|
if (recovery_type != RECTYPE_STANDBY)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1276,7 +1276,7 @@ create_repmgr_extension(PGconn *conn)
|
|||||||
PQExpBufferData query;
|
PQExpBufferData query;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
|
|
||||||
t_extension_status extension_status;
|
ExtensionStatus extension_status;
|
||||||
|
|
||||||
t_connection_user userinfo;
|
t_connection_user userinfo;
|
||||||
bool is_superuser = false;
|
bool is_superuser = false;
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ main(int argc, char **argv)
|
|||||||
* means we're dealing with a supported installation.
|
* means we're dealing with a supported installation.
|
||||||
*
|
*
|
||||||
* The absence of a node record will also indicate that either the node
|
* The absence of a node record will also indicate that either the node
|
||||||
* or repmgr has note been properly configured.
|
* or repmgr has not been properly configured.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Retrieve record for this node from the local database */
|
/* Retrieve record for this node from the local database */
|
||||||
|
|||||||
Reference in New Issue
Block a user