mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Parse recovery.conf file
This will be useful for various kinds of diagnostics.
This commit is contained in:
@@ -46,6 +46,10 @@ do_node_status(void)
|
||||
ItemList warnings = { NULL, NULL };
|
||||
RecoveryType recovery_type;
|
||||
ReplInfo replication_info = T_REPLINFO_INTIALIZER;
|
||||
t_recovery_conf recovery_conf = T_RECOVERY_CONF_INITIALIZER;
|
||||
|
||||
char data_dir[MAXPGPATH] = "";
|
||||
|
||||
|
||||
if (runtime_options.is_shutdown == true)
|
||||
{
|
||||
@@ -57,6 +61,16 @@ do_node_status(void)
|
||||
else
|
||||
conn = establish_db_connection_by_params(&source_conninfo, true);
|
||||
|
||||
if (config_file_options.data_directory[0] != '\0')
|
||||
{
|
||||
strncpy(data_dir, config_file_options.data_directory, MAXPGPATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* requires superuser */
|
||||
get_pg_setting(conn, "data_directory", data_dir);
|
||||
}
|
||||
|
||||
server_version_num = get_server_version(conn, NULL);
|
||||
|
||||
if (runtime_options.node_id != UNKNOWN_NODE_ID)
|
||||
@@ -180,19 +194,8 @@ do_node_status(void)
|
||||
}
|
||||
|
||||
{
|
||||
char data_dir[MAXPGPATH] = "";
|
||||
int ready_files;
|
||||
|
||||
if (config_file_options.data_directory[0] != '\0')
|
||||
{
|
||||
strncpy(data_dir, config_file_options.data_directory, MAXPGPATH);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* requires superuser */
|
||||
get_pg_setting(conn, "data_directory", data_dir);
|
||||
}
|
||||
|
||||
ready_files = get_ready_archive_files(conn, data_dir);
|
||||
|
||||
key_value_list_set_format(
|
||||
@@ -317,6 +320,10 @@ do_node_status(void)
|
||||
key_value_list_set_output_mode(&node_status, "Last replayed LSN", OM_CSV);
|
||||
}
|
||||
|
||||
|
||||
parse_recovery_conf(data_dir, &recovery_conf);
|
||||
|
||||
/* format output */
|
||||
initPQExpBuffer(&output);
|
||||
|
||||
if (runtime_options.output_mode == OM_CSV)
|
||||
|
||||
Reference in New Issue
Block a user