pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: oernii+pg@axonpro.sk
To: pgsql-admin@lists.postgresql.org
Subject: Re: pg15 and VM snapshots with pg_backup_start
Date: Thu, 30 Mar 2023 12:45:39 +0200
Message-ID: <99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at> (raw)
In-Reply-To: <1bd4e56c-f6ad-f711-255a-4432b5f20a62@axonpro.sk>
References: <1bd4e56c-f6ad-f711-255a-4432b5f20a62@axonpro.sk>

On Thu, 2023-03-30 at 11:50 +0200, oernii+pg@axonpro.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





view thread (6+ messages)  latest in thread

Message-ID: <99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at>
Permalink:  ../99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at/
Also on:    postgresql.org/message-id/99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: laurenz.albe@cybertec.at, oernii+pg@axonpro.sk, pgsql-admin@lists.postgresql.org
  Subject: Re: pg15 and VM snapshots with pg_backup_start
  In-Reply-To: <99815bc4cd2622115ea417f6f1e3ceebf8a5247e.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox