mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Only execute pg_stop_backup() if pg_start_backup() was previously executed
It's not a problem per-se but produces some unnecessary and possibly confusing errors.
This commit is contained in:
10
repmgr.c
10
repmgr.c
@@ -915,6 +915,7 @@ do_standby_clone(void)
|
|||||||
retval = SUCCESS;
|
retval = SUCCESS;
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
bool pg_start_backup_executed = false;
|
||||||
bool target_directory_provided = false;
|
bool target_directory_provided = false;
|
||||||
bool config_file_copy_required = false;
|
bool config_file_copy_required = false;
|
||||||
|
|
||||||
@@ -1175,6 +1176,13 @@ do_standby_clone(void)
|
|||||||
goto stop_backup;
|
goto stop_backup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note that we've successfully executed pg_start_backup(),
|
||||||
|
* so we know whether or not to execute pg_stop_backup() after
|
||||||
|
* the 'stop_backup' label
|
||||||
|
*/
|
||||||
|
pg_start_backup_executed = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 1. copy data directory, omitting directories which should not be
|
* 1. copy data directory, omitting directories which should not be
|
||||||
* copied, or for which copying would serve no purpose.
|
* copied, or for which copying would serve no purpose.
|
||||||
@@ -1423,7 +1431,7 @@ do_standby_clone(void)
|
|||||||
|
|
||||||
stop_backup:
|
stop_backup:
|
||||||
|
|
||||||
if(runtime_options.rsync_only)
|
if(runtime_options.rsync_only && pg_start_backup_executed)
|
||||||
{
|
{
|
||||||
log_notice(_("notifying master about backup completion...\n"));
|
log_notice(_("notifying master about backup completion...\n"));
|
||||||
if(stop_backup(upstream_conn, last_wal_segment) == false)
|
if(stop_backup(upstream_conn, last_wal_segment) == false)
|
||||||
|
|||||||
Reference in New Issue
Block a user