mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-28 01:16:29 +00:00
standby clone: check upstream connections after data copy operation
With long-running copy operations, it's possible the connection(s) to the primary/source server may go away for some reason, so recheck their availability before attempting to reuse.
This commit is contained in:
@@ -605,7 +605,6 @@ do_standby_clone(void)
|
||||
log_error(_("unknown clone mode"));
|
||||
}
|
||||
|
||||
|
||||
/* If the backup failed then exit */
|
||||
if (r != SUCCESS)
|
||||
{
|
||||
@@ -5794,6 +5793,12 @@ run_basebackup(t_node_info *node_record)
|
||||
if (r != 0)
|
||||
return ERR_BAD_BASEBACKUP;
|
||||
|
||||
/* check connections are still available */
|
||||
(void)connection_ping_reconnect(primary_conn);
|
||||
|
||||
if (source_conn != primary_conn)
|
||||
(void)connection_ping_reconnect(source_conn);
|
||||
|
||||
/*
|
||||
* If replication slots in use, check the created slot is on the correct
|
||||
* node; the slot will initially get created on the source node, and will
|
||||
@@ -6396,6 +6401,15 @@ stop_backup:
|
||||
RecordStatus record_status = RECORD_NOT_FOUND;
|
||||
PGconn *upstream_conn = NULL;
|
||||
|
||||
|
||||
/* check connections are still available */
|
||||
(void)connection_ping_reconnect(primary_conn);
|
||||
|
||||
if (source_conn != primary_conn)
|
||||
(void)connection_ping_reconnect(source_conn);
|
||||
|
||||
(void)connection_ping_reconnect(source_conn);
|
||||
|
||||
record_status = get_node_record(source_conn, upstream_node_id, &upstream_node_record);
|
||||
|
||||
if (record_status != RECORD_FOUND)
|
||||
|
||||
Reference in New Issue
Block a user