Re: pg15 and VM snapshots with pg_backup_start

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: oernii+pg(at)axonpro(dot)sk, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: pg15 and VM snapshots with pg_backup_start
Date: 2023-03-30 10:45:39
Message-ID: 99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, 2023-03-30 at 11:50 +0200, oernii+pg(at)axonpro(dot)sk wrote:
> Hi, we run a lot of PG14 and lower. We do VM snapshots, which we backup.
> Before the snapshot we run a quiesce script which also runs pg_start_backup().
> After a few seconds the snapshot if finished and we call pg_stop_backup.
> This is working file for us, but pg15 removed this function and replaced it
> with pg_backup_start(), which however requires the session to be open, otherwise we get:
>     WARNING:  aborting backup due to backend exiting before pg_backup_stop was called
>
> For pg15 do I need to keep the session open, will the snapshot contain uncorruped data?

If the snapshot is atomic, that is, represents a state that the file system had
at sume point in time, PostgreSQL can always use it for recovery.

Otherwise, you cannot use this backup, because you only get "backup_label" from
"pg_backup_stop()", and without "backup_label", you cannot recover the backup.

In the latter case, you may find this useful:
https://github.com/cybertec-postgresql/safe-backup

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2023-03-30 10:59:12 Re: pg15 and VM snapshots with pg_backup_start
Previous Message oernii+pg 2023-03-30 09:50:29 pg15 and VM snapshots with pg_backup_start