mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +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)
|
||||
{
|
||||
PGresult *res;
|
||||
t_recovery_type recovery_type = RECTYPE_MASTER;
|
||||
RecoveryType recovery_type = RECTYPE_MASTER;
|
||||
|
||||
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++)
|
||||
{
|
||||
t_recovery_type recovery_type;
|
||||
RecoveryType recovery_type;
|
||||
|
||||
/* initialize with the values of the current node being processed */
|
||||
node_id = atoi(PQgetvalue(res, i, 0));
|
||||
@@ -1079,7 +1079,7 @@ bool atobool(const char *value)
|
||||
/* extension functions */
|
||||
/* =================== */
|
||||
|
||||
t_extension_status
|
||||
ExtensionStatus
|
||||
get_repmgr_extension_status(PGconn *conn)
|
||||
{
|
||||
PQExpBufferData query;
|
||||
|
||||
@@ -28,13 +28,13 @@ typedef enum {
|
||||
REPMGR_AVAILABLE,
|
||||
REPMGR_UNAVAILABLE,
|
||||
REPMGR_UNKNOWN
|
||||
} t_extension_status;
|
||||
} ExtensionStatus;
|
||||
|
||||
typedef enum {
|
||||
RECTYPE_UNKNOWN = 0,
|
||||
RECTYPE_MASTER,
|
||||
RECTYPE_STANDBY
|
||||
} t_recovery_type;
|
||||
} RecoveryType;
|
||||
|
||||
typedef enum {
|
||||
RECORD_ERROR = -1,
|
||||
@@ -188,11 +188,11 @@ bool get_pg_setting(PGconn *conn, const char *setting, char *output);
|
||||
/* server information functions */
|
||||
bool get_cluster_size(PGconn *conn, char *size);
|
||||
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);
|
||||
|
||||
/* extension functions */
|
||||
t_extension_status get_repmgr_extension_status(PGconn *conn);
|
||||
ExtensionStatus get_repmgr_extension_status(PGconn *conn);
|
||||
|
||||
/* result functions */
|
||||
bool atobool(const char *value);
|
||||
|
||||
@@ -24,7 +24,7 @@ do_master_register(void)
|
||||
PGconn *conn = NULL;
|
||||
PGconn *master_conn = NULL;
|
||||
int current_master_id = UNKNOWN_NODE_ID;
|
||||
t_recovery_type recovery_type;
|
||||
RecoveryType recovery_type;
|
||||
t_node_info node_info = T_NODE_INFO_INITIALIZER;
|
||||
RecordStatus record_status;
|
||||
|
||||
@@ -377,7 +377,7 @@ do_master_unregister(void)
|
||||
else
|
||||
{
|
||||
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 */
|
||||
if (recovery_type == RECTYPE_STANDBY)
|
||||
|
||||
@@ -1042,7 +1042,7 @@ do_standby_promote(void)
|
||||
|
||||
char script[MAXLEN];
|
||||
|
||||
t_recovery_type recovery_type;
|
||||
RecoveryType recovery_type;
|
||||
int r;
|
||||
char data_dir[MAXLEN];
|
||||
|
||||
@@ -1584,7 +1584,7 @@ check_source_server()
|
||||
char cluster_size[MAXLEN];
|
||||
t_node_info node_record = T_NODE_INFO_INITIALIZER;
|
||||
RecordStatus record_status;
|
||||
t_extension_status extension_status;
|
||||
ExtensionStatus extension_status;
|
||||
|
||||
/* Attempt to connect to the upstream server to verify its configuration */
|
||||
log_info(_("connecting to upstream node"));
|
||||
@@ -2993,7 +2993,7 @@ check_master_standby_version_match(PGconn *conn, PGconn *master_conn)
|
||||
static void
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1276,7 +1276,7 @@ create_repmgr_extension(PGconn *conn)
|
||||
PQExpBufferData query;
|
||||
PGresult *res;
|
||||
|
||||
t_extension_status extension_status;
|
||||
ExtensionStatus extension_status;
|
||||
|
||||
t_connection_user userinfo;
|
||||
bool is_superuser = false;
|
||||
|
||||
@@ -239,7 +239,7 @@ main(int argc, char **argv)
|
||||
* means we're dealing with a supported installation.
|
||||
*
|
||||
* 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 */
|
||||
|
||||
Reference in New Issue
Block a user