mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
@@ -1889,7 +1889,7 @@ modify_auto_conf(const char *data_dir, KeyValueList *items)
|
|||||||
/*
|
/*
|
||||||
* Note: durable_rename() is not exposed to frontend code before Pg 10.
|
* Note: durable_rename() is not exposed to frontend code before Pg 10.
|
||||||
* We only really need to be modifying postgresql.auto.conf from Pg 12,
|
* We only really need to be modifying postgresql.auto.conf from Pg 12,
|
||||||
* but provide backwards compatibitilty for Pg 9.6 and earlier for the
|
* but provide backwards compatibility for Pg 9.6 and earlier for the
|
||||||
* (unlikely) event that a repmgr built against one of those versions
|
* (unlikely) event that a repmgr built against one of those versions
|
||||||
* is being used against Pg 12 and later.
|
* is being used against Pg 12 and later.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ typedef struct
|
|||||||
/*
|
/*
|
||||||
* undocumented settings
|
* undocumented settings
|
||||||
*
|
*
|
||||||
* These settings are for testing or experimential features
|
* These settings are for testing or experimental features
|
||||||
* and may be changed without notice.
|
* and may be changed without notice.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* controldata.c - functions for reading the pg_control file
|
* controldata.c - functions for reading the pg_control file
|
||||||
*
|
*
|
||||||
* The functions provided here enable repmgr to read a pg_control file
|
* The functions provided here enable repmgr to read a pg_control file
|
||||||
* in a version-indepent way, even if the PostgreSQL instance is not
|
* in a version-independent way, even if the PostgreSQL instance is not
|
||||||
* running. For that reason we can't use on the pg_control_*() functions
|
* running. For that reason we can't use on the pg_control_*() functions
|
||||||
* provided in PostgreSQL 9.6 and later.
|
* provided in PostgreSQL 9.6 and later.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4825,7 +4825,7 @@ cancel_query(PGconn *conn, int timeout)
|
|||||||
* Wait until current query finishes, ignoring any results.
|
* Wait until current query finishes, ignoring any results.
|
||||||
* Usually this will be an async query or query cancellation.
|
* Usually this will be an async query or query cancellation.
|
||||||
*
|
*
|
||||||
* Returns 1 for success; 0 if any error ocurred; -1 if timeout reached.
|
* Returns 1 for success; 0 if any error occurred; -1 if timeout reached.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
wait_connection_availability(PGconn *conn, int timeout)
|
wait_connection_availability(PGconn *conn, int timeout)
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ mkdir_p(char *path, mode_t omode)
|
|||||||
/*
|
/*
|
||||||
* POSIX 1003.2: For each dir operand that does not name an
|
* POSIX 1003.2: For each dir operand that does not name an
|
||||||
* existing directory, effects equivalent to those caused by the
|
* existing directory, effects equivalent to those caused by the
|
||||||
* following command shall occcur:
|
* following command shall occur:
|
||||||
*
|
*
|
||||||
* mkdir -p -m $(umask -S),u+wx $(dirname dir) && mkdir [-m mode]
|
* mkdir -p -m $(umask -S),u+wx $(dirname dir) && mkdir [-m mode]
|
||||||
* dir
|
* dir
|
||||||
@@ -289,7 +289,7 @@ is_pg_running(const char *path)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* No PID file - PostgreSQL shouldn't be running. From 9.3 (the
|
* No PID file - PostgreSQL shouldn't be running. From 9.3 (the
|
||||||
* earliesty version we care about) removal of the PID file will
|
* earliest version we care about) removal of the PID file will
|
||||||
* cause the postmaster to shut down, so it's highly unlikely
|
* cause the postmaster to shut down, so it's highly unlikely
|
||||||
* that PostgreSQL will still be running.
|
* that PostgreSQL will still be running.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1939,7 +1939,7 @@ do_standby_register(void)
|
|||||||
/*
|
/*
|
||||||
* If --upstream-node-id not provided, we're defaulting to the primary as
|
* If --upstream-node-id not provided, we're defaulting to the primary as
|
||||||
* upstream node. If local node is available, double-check that it's attached
|
* upstream node. If local node is available, double-check that it's attached
|
||||||
* to the primary, in case --upstream-node-id was an accidental ommission.
|
* to the primary, in case --upstream-node-id was an accidental omission.
|
||||||
*
|
*
|
||||||
* Currently we'll only do this for newly registered nodes.
|
* Currently we'll only do this for newly registered nodes.
|
||||||
*/
|
*/
|
||||||
@@ -3402,7 +3402,7 @@ do_standby_follow_internal(PGconn *primary_conn, PGconn *follow_target_conn, t_n
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In the unlikley event that fails, we'll fall back to a restart */
|
/* In the unlikely event that fails, we'll fall back to a restart */
|
||||||
log_warning(_("unable to reload server configuration"));
|
log_warning(_("unable to reload server configuration"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3633,7 +3633,7 @@ do_standby_switchover(void)
|
|||||||
* SANITY CHECKS
|
* SANITY CHECKS
|
||||||
*
|
*
|
||||||
* We'll be doing a bunch of operations on the remote server (primary to
|
* We'll be doing a bunch of operations on the remote server (primary to
|
||||||
* be demoted) - careful checks needed before proceding.
|
* be demoted) - careful checks needed before proceeding.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
local_conn = establish_db_connection(config_file_options.conninfo, true);
|
local_conn = establish_db_connection(config_file_options.conninfo, true);
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Tell the logger we're a command-line program - this will ensure any
|
* Tell the logger we're a command-line program - this will ensure any
|
||||||
* output logged before the logger is initialized will be formatted
|
* output logged before the logger is initialized will be formatted
|
||||||
* correctly. Can be overriden with "--log-to-file".
|
* correctly. Can be overridden with "--log-to-file".
|
||||||
*/
|
*/
|
||||||
logger_output_mode = OM_COMMAND_LINE;
|
logger_output_mode = OM_COMMAND_LINE;
|
||||||
|
|
||||||
@@ -2735,7 +2735,7 @@ do_help(void)
|
|||||||
*
|
*
|
||||||
* Note:
|
* Note:
|
||||||
* This is one of two places where superuser rights are required.
|
* This is one of two places where superuser rights are required.
|
||||||
* We should also consider possible scenarious where a non-superuser
|
* We should also consider possible scenarios where a non-superuser
|
||||||
* has sufficient privileges to install the extension.
|
* has sufficient privileges to install the extension.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -2936,7 +2936,7 @@ check_server_version(PGconn *conn, char *server_type, bool exit_on_error, char *
|
|||||||
* PostgreSQL from a particular PostgreSQL release onwards (e.g. 4.4 with PostgreSQL
|
* PostgreSQL from a particular PostgreSQL release onwards (e.g. 4.4 with PostgreSQL
|
||||||
* 12 and later due to recovery.conf removal), set MAX_UNSUPPORTED_VERSION and
|
* 12 and later due to recovery.conf removal), set MAX_UNSUPPORTED_VERSION and
|
||||||
* MAX_UNSUPPORTED_VERSION_NUM in "repmgr.h" to define the first PostgreSQL
|
* MAX_UNSUPPORTED_VERSION_NUM in "repmgr.h" to define the first PostgreSQL
|
||||||
* version which can't be suppored.
|
* version which can't be supported.
|
||||||
*/
|
*/
|
||||||
#ifdef MAX_UNSUPPORTED_VERSION_NUM
|
#ifdef MAX_UNSUPPORTED_VERSION_NUM
|
||||||
if (conn_server_version_num >= MAX_UNSUPPORTED_VERSION_NUM)
|
if (conn_server_version_num >= MAX_UNSUPPORTED_VERSION_NUM)
|
||||||
|
|||||||
@@ -737,7 +737,7 @@ check_primary_status(int degraded_monitoring_elapsed)
|
|||||||
/* refresh our copy of the node record from the primary */
|
/* refresh our copy of the node record from the primary */
|
||||||
record_status = get_node_record(new_primary_conn, config_file_options.node_id, &local_node_info);
|
record_status = get_node_record(new_primary_conn, config_file_options.node_id, &local_node_info);
|
||||||
|
|
||||||
/* this is unlikley to happen */
|
/* this is unlikely to happen */
|
||||||
if (record_status != RECORD_FOUND)
|
if (record_status != RECORD_FOUND)
|
||||||
{
|
{
|
||||||
log_warning(_("unable to retrieve local node record from primary node %i"), primary_node_id);
|
log_warning(_("unable to retrieve local node record from primary node %i"), primary_node_id);
|
||||||
@@ -1111,7 +1111,7 @@ execute_child_nodes_disconnect_command(NodeInfoList *db_child_node_records, t_ch
|
|||||||
/* calculate number of connected child nodes */
|
/* calculate number of connected child nodes */
|
||||||
for (cell = db_child_node_records->head; cell; cell = cell->next)
|
for (cell = db_child_node_records->head; cell; cell = cell->next)
|
||||||
{
|
{
|
||||||
/* exclude witness server from total, if necessay */
|
/* exclude witness server from total, if necessary */
|
||||||
if (config_file_options.child_nodes_connected_include_witness == false &&
|
if (config_file_options.child_nodes_connected_include_witness == false &&
|
||||||
cell->node_info->type == WITNESS)
|
cell->node_info->type == WITNESS)
|
||||||
continue;
|
continue;
|
||||||
@@ -1149,7 +1149,7 @@ execute_child_nodes_disconnect_command(NodeInfoList *db_child_node_records, t_ch
|
|||||||
instr_time current_time = current_time_base;
|
instr_time current_time = current_time_base;
|
||||||
int seconds_since_detached;
|
int seconds_since_detached;
|
||||||
|
|
||||||
/* exclude witness server from calculatin if neccessary */
|
/* exclude witness server from calculating if necessary */
|
||||||
if (config_file_options.child_nodes_connected_include_witness == false &&
|
if (config_file_options.child_nodes_connected_include_witness == false &&
|
||||||
child_node_rec->type == WITNESS)
|
child_node_rec->type == WITNESS)
|
||||||
continue;
|
continue;
|
||||||
@@ -3254,7 +3254,7 @@ update_monitoring_history(void)
|
|||||||
*
|
*
|
||||||
* Attach cascaded standby to another node, currently the primary.
|
* Attach cascaded standby to another node, currently the primary.
|
||||||
*
|
*
|
||||||
* Note that in contrast to a primary failover, where one of the downstrean
|
* Note that in contrast to a primary failover, where one of the downstream
|
||||||
* standby nodes will become a primary, a cascaded standby failover (where the
|
* standby nodes will become a primary, a cascaded standby failover (where the
|
||||||
* upstream standby has gone away) is "just" a case of attaching the standby to
|
* upstream standby has gone away) is "just" a case of attaching the standby to
|
||||||
* another node.
|
* another node.
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ main(int argc, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Parse the configuration file, if provided (if no configuration file was
|
* Parse the configuration file, if provided (if no configuration file was
|
||||||
* provided, an attempt will be made to find one in one of the default
|
* provided, an attempt will be made to find one in one of the default
|
||||||
* locations). If no conifguration file is available, or it can't be parsed
|
* locations). If no configuration file is available, or it can't be parsed
|
||||||
* parse_config() will abort anyway, with an appropriate message.
|
* parse_config() will abort anyway, with an appropriate message.
|
||||||
*/
|
*/
|
||||||
load_config(config_file, verbose, false, argv[0]);
|
load_config(config_file, verbose, false, argv[0]);
|
||||||
@@ -307,7 +307,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Some configuration file items can be overriden by command line options */
|
/* Some configuration file items can be overridden by command line options */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Command-line parameter -L/--log-level overrides any setting in config
|
* Command-line parameter -L/--log-level overrides any setting in config
|
||||||
|
|||||||
Reference in New Issue
Block a user