diff --git a/repmgr-action-standby.c b/repmgr-action-standby.c index 9eb2bbc5..290c2e99 100644 --- a/repmgr-action-standby.c +++ b/repmgr-action-standby.c @@ -187,6 +187,9 @@ do_standby_clone(void) copy_conninfo_params(&recovery_conninfo, &source_conninfo); + /* Set the default application name to this node's name */ + param_set(&recovery_conninfo, "application_name", config_file_options.node_name); + /* * If application_name is set in repmgr.conf's conninfo parameter, use * this value (if the source host was provided as a conninfo string, any @@ -211,10 +214,12 @@ do_standby_clone(void) * --upstream-conninfo supplied, which we interpret to imply * --no-upstream-connection as well - the use case for this option is when * the upstream is not available, so no point in checking for it. + * + * XXX not sure of the logic here (and yes I did think this up) */ if (*runtime_options.upstream_conninfo) - runtime_options.no_upstream_connection = true; + runtime_options.no_upstream_connection = false; /* By default attempt to connect to the source server */ if (runtime_options.no_upstream_connection == false) diff --git a/repmgr-client.c b/repmgr-client.c index 5d1d6de1..20f96434 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -1441,6 +1441,12 @@ get_superuser_connection(PGconn **conn, PGconn **superuser_conn, PGconn **privil t_connection_user userinfo; bool is_superuser; + /* this should never happen */ + if (PQstatus(conn) != CONNECTION_OK) + { + log_error(_("no database connection available")); + exit(ERR_INTERNAL); + } is_superuser = is_superuser_connection(*conn, &userinfo); if (is_superuser == true)