Re: Remove Deprecated Exclusive Backup Mode

From: David Steele <david(at)pgmasters(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove Deprecated Exclusive Backup Mode
Date: 2020-07-01 21:20:16
Message-ID: 0eba0ef0-6320-7206-1748-07d79aad9bd3@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/1/20 4:32 PM, Bruce Momjian wrote:
> On Wed, Jul 1, 2020 at 04:27:58PM -0400, David Steele wrote:
>> On 7/1/20 3:58 PM, Robert Haas wrote:
>>> If we could jigger things so that you don't need to stop the backup at
>>> all, you only start it, and whether you ever finish copying everything
>>> is something about which the system need not know or care, that would
>>> be a lot nicer. I'm not sure I see how to do that, though.
>>
>> Well, the only thing pg_stop_backup() *really* needs to know is the starting
>> WAL position. pg_start_backup() gets that info so if it passes it back to
>> pg_stop_backup() that could be enough. Or as was proposed above, it just
>
> Doesn't pg_start_backup already return this?
>
> SELECT pg_start_backup('test');
> pg_start_backup
> -----------------
> --> 0/2000028

It does, though after looking at the code I think we need the entire
backup_label. For any of this to be useful, pg_start_backup() *must*
return backup_label anyway so it can be stored somewhere the backup
software can find it.

>> Here's a thought. What if we just stored the oldest starting LSN and a count
>> of how many backups have been requested. When the backup ends it checks that
>> backup count is > 0 and starting LSN is <= its starting LSN. If not, it
>> throws an error. When backups go to 0 FPWs are turned off if they were off
>> before the first backup.
>
> Can't we just error out of an exclusive-style backup is requested to
> start and a previous exclusive-style backup has not been stopped?

That means only allowing one exclusive backup but it's not like we don't
already have that limitation. But -- I'd rather not even need to specify
exclusive/non-exclusive when the backup is started. Basically, all
backups would be non-exclusive but we'd allow pg_stop_backup() to be
called in a new session (or the same session).

Regards,
--
-David
david(at)pgmasters(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2020-07-01 21:24:52 Re: proposal: possibility to read dumped table's name from file
Previous Message Joe Conway 2020-07-01 21:17:16 Re: pg_read_file() with virtual files returns empty string