repmgr: prevent spurious error message when running 'standby switchover'

When 'repmgr standby follow' is run on a dormant server, with connection
parameters for the upstream node provided (which is done during the
switchover process to reintegrate the stopped former master into the
replication cluster), a spurious error message is generated about
a slot which cannot be deleted as it's active. During the switchover
process the current master's (former standby's) slot on the former master
is deleted at a later point so can be skipped here.

The error message is annoying but harmless and has no effect on the
switchover process.

Addresses GitHub #285.
This commit is contained in:
Ian Barwick
2017-04-10 22:49:14 +09:00
parent 9c28d3626b
commit 870a367d3b

View File

@@ -4764,7 +4764,7 @@ do_standby_follow(void)
* (a former standby) exists on the former upstream, drop it.
*/
if (options.use_replication_slots && original_upstream_node_id != UNKNOWN_NODE_ID)
if (options.use_replication_slots && runtime_options.host_param_provided == false && original_upstream_node_id != UNKNOWN_NODE_ID)
{
t_node_info upstream_node_record = T_NODE_INFO_INITIALIZER;
int upstream_query_result;