mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
Don't try and log events when no master connection available
This commit is contained in:
23
repmgrd.c
23
repmgrd.c
@@ -265,31 +265,22 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Verify that server is a supported version */
|
/* Verify that server is a supported version */
|
||||||
log_info(_("connected to database, checking its state\n"));
|
log_info(_("connected to database, checking its state\n"));
|
||||||
|
|
||||||
server_version_num = get_server_version(my_local_conn, NULL);
|
server_version_num = get_server_version(my_local_conn, NULL);
|
||||||
|
|
||||||
if(server_version_num < MIN_SUPPORTED_VERSION_NUM)
|
if(server_version_num < MIN_SUPPORTED_VERSION_NUM)
|
||||||
{
|
{
|
||||||
PQExpBufferData errmsg;
|
|
||||||
initPQExpBuffer(&errmsg);
|
|
||||||
|
|
||||||
if (server_version_num > 0)
|
if (server_version_num > 0)
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(&errmsg,
|
log_err(_("%s requires PostgreSQL %s or later\n"),
|
||||||
_("%s requires PostgreSQL %s or later"),
|
progname,
|
||||||
progname,
|
MIN_SUPPORTED_VERSION) ;
|
||||||
MIN_SUPPORTED_VERSION);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(&errmsg,
|
log_err(_("unable to determine PostgreSQL server version\n"));
|
||||||
_("unable to determine PostgreSQL server version"));
|
|
||||||
}
|
}
|
||||||
log_err("%s\n", errmsg.data);
|
|
||||||
create_event_record(my_local_conn,
|
|
||||||
&local_options,
|
|
||||||
local_options.node,
|
|
||||||
"repmgrd_shutdown",
|
|
||||||
false,
|
|
||||||
errmsg.data);
|
|
||||||
terminate(ERR_BAD_CONFIG);
|
terminate(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user