Fix return value of pg_reload_conf() database utility function

Would always return "false", but as the value wasn't used anywhere,
the issue was inconsequential.

However while we're at it, actually check the return value in the
two places it's called, to help diagnose any issues in the unlikely
event they occur.

Per issue reported via GitHub PR #671 from user duzhgg.
This commit is contained in:
Ian Barwick
2020-10-30 14:25:11 +09:00
committed by Ian Barwick
parent ad6dde4218
commit 9fb9decf13
2 changed files with 18 additions and 3 deletions

View File

@@ -289,10 +289,19 @@ disable_wal_receiver(PGconn *conn)
if (wal_retrieve_retry_interval < WALRECEIVER_DISABLE_TIMEOUT_VALUE)
{
bool success;
log_notice(_("setting \"wal_retrieve_retry_interval\" to %i milliseconds"),
new_wal_retrieve_retry_interval);
alter_system_int(conn, "wal_retrieve_retry_interval", new_wal_retrieve_retry_interval);
pg_reload_conf(conn);
success = pg_reload_conf(conn);
if (success == false)
{
log_warning(_("unable to reload configuration"));
return UNKNOWN_PID;
}
}
/*
@@ -400,7 +409,13 @@ enable_wal_receiver(PGconn *conn, bool wait_startup)
return UNKNOWN_PID;
}
pg_reload_conf(conn);
success = pg_reload_conf(conn);
if (success == false)
{
log_warning(_("unable to reload configuration"));
return UNKNOWN_PID;
}
}
else
{