Re: Running rsync backups in pg15 - Mailing list pgsql-admin

From Fujii Masao
Subject Re: Running rsync backups in pg15
Date
Msg-id bf3a4125-378c-4085-af26-e211c758e8ed@oss.nttdata.com
Whole thread Raw
In response to RE: Running rsync backups in pg15  (Murthy Nunna <mnunna@fnal.gov>)
Responses RE: Running rsync backups in pg15
List pgsql-admin

On 2024/11/09 1:53, Murthy Nunna wrote:
> Yes, I know. Exclusive backups are removed.
> 
>  From release notes of 15:
> 
>   * Remove long-deprecated *exclusive backup mode*
<https://www.postgresql.org/docs/15/continuous-archiving.html#BACKUP-BASE-BACKUP> (DavidSteele, Nathan Bossart)
 
> 
> If the database server stops abruptly while in this mode, the server could fail to start. The non-exclusive backup
modeis considered superior for all purposes. Functions pg_start_backup()/pg_stop_backup() have been renamed to
pg_backup_start()/pg_backup_stop(),and the functions pg_backup_start_time() and pg_is_in_backup() have been removed.
 
> 
> Sorry my question was not clear. As per above release notes - If the database server stops abruptly while in this
mode,the server could fail to start. However, I crash tested in pg14 (stopped abruptly during exclusive backup) but the
clusterstill started fine. Pg14 renamed backup_label to backup_label.old and restarted the cluster successfully.
 

If the server crashes during backup mode and the WAL files indicated by backup_label
as the recovery starting point are removed (due to checkpoints during backup mode),
the server won't start. You can reproduce this issue with the following steps, for example.

--------------------
initdb -D data
pg_ctl -D data start
psql -c "select pg_start_backup('test', true)"
psql -c "select pg_switch_wal(); checkpoint"
psql -c "select pg_switch_wal(); checkpoint"
kill -9 $(head -1 data/postmaster.pid)
pg_ctl -D data start
--------------------

I understand some people still prefer exclusive backups for some reasons, which is
why I developed the pg_exclusive_backup extension that provides functions for
exclusive backups on PostgreSQL 15 or later. However, since this is an unofficial extension,
it's generally better to update your backup method or script to use non-exclusive backups.
https://github.com/MasaoFujii/pg_exclusive_backup

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION




pgsql-admin by date:

Previous
From: Murthy Nunna
Date:
Subject: RE: Running rsync backups in pg15
Next
From: Murthy Nunna
Date:
Subject: RE: Running rsync backups in pg15