Re: Add recovery to pg_control and remove backup_label

From: David Steele <david(at)pgmasters(dot)net>
To: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add recovery to pg_control and remove backup_label
Date: 2023-11-21 11:42:42
Message-ID: 8f631b90-6cc2-4c48-bfe6-aaed6d07c912@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/20/23 19:58, Andres Freund wrote:
>
> On 2023-11-21 08:52:08 +0900, Michael Paquier wrote:
>> On Mon, Nov 20, 2023 at 12:37:46PM -0800, Andres Freund wrote:
>>> Given that, I wonder if what we should do is to just add a new field to
>>> pg_control that says "error out if backup_label does not exist", that we set
>>> when creating a streaming base backup
>>
>> That would mean that one still needs to take an extra step to update a
>> control file with this byte set, which is something you had a concern
>> with in terms of compatibility when it comes to external backup
>> solutions because more steps are necessary to take a backup, no?
>
> I was thinking we'd just set it in the pg_basebackup style path, and we'd
> error out if it's set and backup_label is present. But we'd still use
> backup_label without the pg_control flag set.
>
> So it'd just provide a cross-check that backup_label was not removed for
> pg_basebackup style backup, but wouldn't do anything for external backups. But
> imo the proposal to just us pg_control doesn't actually do anything for
> external backups either - which is why I think my proposal would achieve as
> much, for a much lower price.

I'm not sure why you think the patch under discussion doesn't do
anything for external backups. It provides the same benefits to both
pg_basebackup and external backups, i.e. they both receive the updated
version of pg_control.

I really dislike the idea of pg_basebackup having a special mechanism
for making recovery safer that is not generally available to external
backup software. It might be easy enough for some (e.g. pgBackRest) to
manipulate pg_control but would be out of reach for most.

Regards,
-David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-11-21 11:47:38 undetected deadlock in ALTER SUBSCRIPTION ... REFRESH PUBLICATION
Previous Message Alena Rybakina 2023-11-21 11:31:11 Re: POC, WIP: OR-clause support for indexes