mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +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;
|
||||
|
||||
int i;
|
||||
bool pg_start_backup_executed = false;
|
||||
bool target_directory_provided = false;
|
||||
bool config_file_copy_required = false;
|
||||
|
||||
@@ -1175,6 +1176,13 @@ do_standby_clone(void)
|
||||
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
|
||||
* copied, or for which copying would serve no purpose.
|
||||
@@ -1423,7 +1431,7 @@ do_standby_clone(void)
|
||||
|
||||
stop_backup:
|
||||
|
||||
if(runtime_options.rsync_only)
|
||||
if(runtime_options.rsync_only && pg_start_backup_executed)
|
||||
{
|
||||
log_notice(_("notifying master about backup completion...\n"));
|
||||
if(stop_backup(upstream_conn, last_wal_segment) == false)
|
||||
|
||||
Reference in New Issue
Block a user