mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
"standby clone": fix --superuser handling
get_superuser_connection() was erroneously using the local node record to connect to as a superuser, which works when registering the primary but obviously not when cloning a standby. Addresses GitHub #380.
This commit is contained in:
@@ -4288,7 +4288,7 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *node_in
|
||||
|
||||
param_set(&repl_conninfo, "replication", "1");
|
||||
|
||||
if (*runtime_options.replication_user)
|
||||
if (runtime_options.replication_user[0] != '\0')
|
||||
{
|
||||
param_set(&repl_conninfo, "user", runtime_options.replication_user);
|
||||
}
|
||||
@@ -4343,12 +4343,13 @@ check_upstream_config(PGconn *conn, int server_version_num, t_node_info *node_in
|
||||
* XXX at this point we could check
|
||||
* current_setting('max_wal_senders) - COUNT(*) FROM
|
||||
* pg_stat_replication; if >= min_replication_connections we could
|
||||
* infer possible authentication error.
|
||||
* infer possible authentication error / lack of permissions.
|
||||
*
|
||||
* Alternatively call PQconnectStart() and poll for
|
||||
* presence/absence of CONNECTION_AUTH_OK ?
|
||||
*/
|
||||
log_error(_("unable to establish necessary replication connections"));
|
||||
|
||||
log_hint(_("increase \"max_wal_senders\" by at least %i"),
|
||||
min_replication_connections - possible_replication_connections);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user