mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
1
HISTORY
1
HISTORY
@@ -1,5 +1,6 @@
|
||||
4.0.5 2018-??-??
|
||||
repmgr: fix display of conninfo parsing error messages (Ian)
|
||||
repmgr: fix "repmgr cluster crosscheck" output; GitHub #389 (Ian)
|
||||
repmgrd: fix memory leaks in witness code (AndrzejNowicki, Martín)
|
||||
repmgrd: set "connect_timeout=2" when pinging a server (Ian)
|
||||
|
||||
|
||||
@@ -964,8 +964,7 @@ build_cluster_matrix(t_node_matrix_rec ***matrix_rec_dest, int *name_length)
|
||||
|
||||
initPQExpBuffer(&command_output);
|
||||
|
||||
(void) remote_command(
|
||||
host,
|
||||
(void) remote_command(host,
|
||||
runtime_options.remote_user,
|
||||
command.data,
|
||||
&command_output);
|
||||
@@ -1144,9 +1143,8 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length)
|
||||
/* fix to work with --node-id */
|
||||
if (cube[i]->node_id == config_file_options.node_id)
|
||||
{
|
||||
(void) local_command(
|
||||
command.data,
|
||||
&command_output);
|
||||
(void) local_command_simple(command.data,
|
||||
&command_output);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1170,8 +1168,7 @@ build_cluster_crosscheck(t_node_status_cube ***dest_cube, int *name_length)
|
||||
|
||||
log_verbose(LOG_DEBUG, "build_cluster_crosscheck(): executing\n %s", quoted_command.data);
|
||||
|
||||
(void) remote_command(
|
||||
host,
|
||||
(void) remote_command(host,
|
||||
runtime_options.remote_user,
|
||||
quoted_command.data,
|
||||
&command_output);
|
||||
|
||||
@@ -207,6 +207,7 @@ extern void check_93_config(void);
|
||||
extern bool create_repmgr_extension(PGconn *conn);
|
||||
extern int test_ssh_connection(char *host, char *remote_user);
|
||||
extern bool local_command(const char *command, PQExpBufferData *outputbuf);
|
||||
extern bool local_command_simple(const char *command, PQExpBufferData *outputbuf);
|
||||
|
||||
extern standy_clone_mode get_standby_clone_mode(void);
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ t_node_info target_node_info = T_NODE_INFO_INITIALIZER;
|
||||
static ItemList cli_errors = {NULL, NULL};
|
||||
static ItemList cli_warnings = {NULL, NULL};
|
||||
|
||||
static bool _local_command(const char *command, PQExpBufferData *outputbuf, bool simple);
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@@ -2096,12 +2097,28 @@ test_ssh_connection(char *host, char *remote_user)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Execute a command locally. "outputbuf" should either be an
|
||||
* initialised PQexpbuffer, or NULL
|
||||
*/
|
||||
bool
|
||||
local_command(const char *command, PQExpBufferData *outputbuf)
|
||||
{
|
||||
return _local_command(command, outputbuf, false);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
local_command_simple(const char *command, PQExpBufferData *outputbuf)
|
||||
{
|
||||
return _local_command(command, outputbuf, true);
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
_local_command(const char *command, PQExpBufferData *outputbuf, bool simple)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
char output[MAXLEN];
|
||||
@@ -2128,7 +2145,8 @@ local_command(const char *command, PQExpBufferData *outputbuf)
|
||||
while (fgets(output, MAXLEN, fp) != NULL)
|
||||
{
|
||||
appendPQExpBuffer(outputbuf, "%s", output);
|
||||
if (!feof(fp))
|
||||
|
||||
if (!feof(fp) && simple == false)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -2352,9 +2370,6 @@ copy_remote_files(char *host, char *remote_user, char *remote_path,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Execute a command via ssh on the remote host.
|
||||
*
|
||||
@@ -2420,7 +2435,7 @@ remote_command(const char *host, const char *user, const char *command, PQExpBuf
|
||||
if (outputbuf != NULL)
|
||||
{
|
||||
if (strlen(outputbuf->data))
|
||||
log_verbose(LOG_DEBUG, "remote_command(): output returned was:\n %s", outputbuf->data);
|
||||
log_verbose(LOG_DEBUG, "remote_command(): output returned was:\n%s", outputbuf->data);
|
||||
else
|
||||
log_verbose(LOG_DEBUG, "remote_command(): no output returned");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user