Issue
I'm seeing errors like the following in my logs:
[37-1] sql_error_code = 55000 ERROR: exclusive backup not in progress
[37-2] sql_error_code = 55000 STATEMENT: select pg_stop_backup()
as well as other messages and warnings, such as:
[37-1] sql_error_code = 00000 LOG: duration: 398930.917 ms statement: COPY (SELECT file_name, lpad(file_offset::text, 8, '0') AS file_offset FROM pg_xlogfile_name_offset( pg_start_backup('freeze_start_2020-05-11T13:44:04.251148+00:00'))) TO STDOUT WITH CSV HEADER;
[40-1] sql_error_code = 00000 NOTICE: pg_stop_backup complete, all required WAL segments have been archived
[8-1] sql_error_code = 01000 WARNING: aborting backup due to backend exiting before pg_stop_backup was called
Is this something I need to address? Is there a problem with my database backups?
Resolution
These PostgreSQL statements and their corresponding error/warning logs are part of the automated tasks we run on Heroku Postgres for Continuous Protection.
At a high-level, the pg_stop_backup
and pg_start_backup
function calls that you'd find in the logs related to the "exclusive backup not in progress" messages are the commands we use when we tell PostgreSQL to prepare for a disk snapshot.
These log messages are not known to cause any issues and can be safely ignored.