pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgbackrest.org>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: solai v <solai.cdac@gmail.com>
Subject: Re: Return pg_control from pg_backup_stop().
Date: Wed, 28 Oct 2026 10:55:11 +0000 (UTC)
Message-ID: <3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org> (raw)
In-Reply-To: <3e174819-8682-444b-905c-c2c40a709c8f@iki.fi>
References: <8b8aa673-fcef-4e14-a05d-0885283ef1b8@pgbackrest.org>
	<f74cab02-5ebb-439c-975b-29d019eed787@pgbackrest.org>
	<17DC1346-0CDE-4E39-B110-3D6FB0797AC6@gmail.com>
	<feb68313-3257-4d9d-8b69-6468e506a61a@pgbackrest.org>
	<7F7B289B-F94F-42C2-9E54-6A689C0D64BB@gmail.com>
	<aboDQSoywyKGGNCr@paquier.xyz>
	<1800c83c-264a-4183-9da5-ac78e25849a8@pgbackrest.org>
	<abov3-Kre8ntiL-S@paquier.xyz>
	<3b23e3b7-53d2-4784-b482-05cca3327acb@pgbackrest.org>
	<abphw4g2TwuPP0Cv@paquier.xyz>
	<df9e4c1f-4178-47fb-abdd-9829f7079b44@pgbackrest.org>
	<4193dcbc-591e-44bb-816c-43b4ae70d31c@pgbackrest.org>
	<86436ff9-eb98-4c8a-825e-3bcae022107b@pgbackrest.org>
	<CAF0whueXubW3F4aaHOzMTbz92smb1bQ1MY_MiqXnmh-t1JmeYQ@mail.gmail.com>
	<9b37265e-8025-4e8a-9a9c-c4232eaf746f@pgbackrest.org>
	<d1697de1-eb7f-41bf-a4b7-bba7203df11f@pgbackrest.org>
	<7971d005-e713-4a17-b0d9-855d9897ef14@iki.fi>
	<9ae9db4e-5a6a-4b4d-aa24-7e5da664bd0e@pgbackrest.org>
	<3e174819-8682-444b-905c-c2c40a709c8f@iki.fi>

On 10/28/26 10:48, Heikki Linnakangas wrote:
> On 26/10/2026 13:42, David Steele wrote:
>> On 10/23/26 18:17, Heikki Linnakangas wrote:
>>> On 23/10/2026 15:42, David Steele wrote:
>>> Umm, not new with his patch, but why do we still have that hint to 
>>> remove backup_label? Is that ever the right thing to do? Why didn't 
>>> we remove that hint when exclusive-mode backups were removed?
>>
>> Unfortunately I believe there is still a use case for this hint. When 
>> making a backup, e.g. via snapshot, it is still easier to write the 
>> backup_label into PGDATA, make the snapshot, then remove it. If the 
>> cluster crashes before the removal then the answer is to remove the 
>> backup label, just as it was if exclusive backup crashed.
>>
>> I'm not excited about the above use case but not sure we can discount 
>> it entirely.
> 
> If you take an atomic filesystem-level snapshot, restoring it is 
> equivalent to crash recovery, so you don't need a backup_label to 
> restore it to a consistent state. There's no need for pg_start_backup() 
> or a backup_label in that case. Admittedly, a non-atomic snapshot is a 
> different story.

True, but I recommend *always* using the documented backup procedure, 
especially if PITR will be used on restore.

> But I don't see how you could do that anyway. The backup_label is 
> returned by pg_stop_backup(). If the sequence is:
> 
> 1. pg_start_backup()
> 2. take filesystem snapshot
> 3. pg_stop_backup()
> 
> there's no way to include the backup_label in the snapshot, because you 
> don't have it until you call pg_stop_backup().
Oops, yeah, that was an old pattern what was still usable up until PG14 
but should no longer be possible.

I searched the thread where we removed exclusive backup and I can't see 
any reason why we would have kept it, so it was probably an oversight.

Once Michael and I have resolved the build farm issue with 01 I'll 
rebase and make the removal a small patch before adding the pgcontrol 
flag -- unless you would prefer a separate thread.

Regards,
-David





view thread (64+ messages)  latest in thread

Message-ID: <3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org>
Permalink:  ../3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org/
Also on:    postgresql.org/message-id/3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: david@pgbackrest.org, hlinnaka@iki.fi, michael@paquier.xyz, robertmhaas@gmail.com, andres@anarazel.de, masao.fujii@gmail.com, solai.cdac@gmail.com
  Subject: Re: Return pg_control from pg_backup_stop().
  In-Reply-To: <3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org>
  References: <8b8aa673-fcef-4e14-a05d-0885283ef1b8@pgbackrest.org> <17DC1346-0CDE-4E39-B110-3D6FB0797AC6@gmail.com> <feb68313-3257-4d9d-8b69-6468e506a61a@pgbackrest.org> <7F7B289B-F94F-42C2-9E54-6A689C0D64BB@gmail.com> <aboDQSoywyKGGNCr@paquier.xyz> <1800c83c-264a-4183-9da5-ac78e25849a8@pgbackrest.org> <abov3-Kre8ntiL-S@paquier.xyz> <3b23e3b7-53d2-4784-b482-05cca3327acb@pgbackrest.org> <abphw4g2TwuPP0Cv@paquier.xyz> <df9e4c1f-4178-47fb-abdd-9829f7079b44@pgbackrest.org> <4193dcbc-591e-44bb-816c-43b4ae70d31c@pgbackrest.org> <86436ff9-eb98-4c8a-825e-3bcae022107b@pgbackrest.org> <CAF0whueXubW3F4aaHOzMTbz92smb1bQ1MY_MiqXnmh-t1JmeYQ@mail.gmail.com> <9b37265e-8025-4e8a-9a9c-c4232eaf746f@pgbackrest.org> <d1697de1-eb7f-41bf-a4b7-bba7203df11f@pgbackrest.org> <7971d005-e713-4a17-b0d9-855d9897ef14@iki.fi> <9ae9db4e-5a6a-4b4d-aa24-7e5da664bd0e@pgbackrest.org> <3e174819-8682-444b-905c-c2c40a709c8f@iki.fi> <3bddbc41-b274-47b6-abd4-d11918906b32@pgbackrest.org>

* 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