Re: v12 and TimeLine switches and backups/restores

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: v12 and TimeLine switches and backups/restores
Date: 2020-07-01 20:08:21
Message-ID: CA+TgmoY4Rd4A-bE8gsT6zrrraSReoA-RoUD7RoBQVoVd6P=+cA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 1, 2020 at 4:02 PM Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> There's two solutions, really- first would be, as you suggest, configure
> PG to stay on the timeline that the backup was taken on, but I suspect
> that's often *not* what the user actually wants- what they really want
> is to restore an earlier backup (one taken before the TL switch) and
> then have PG follow the timeline switch when it comes across it.

It seems, though, that if it IS what the user actually wants, they're
now going to get the wrong behavior by default, and that seems pretty
undesirable.

> There's another option here, though I rejected it, which is that we
> could possibly force the restore to ignore a TL switch before reaching
> consistency, but if we do that then, sure, we'll finish the restore but
> we won't be on the TL that the user asked us to be, and we wouldn't be
> able to follow a primary that's on that TL, so ultimately the restore
> wouldn't actually be what the user wanted. There's really not an option
> to do what the user wanted except to find an earlier backup to restore,
> so that's why I'm proposing that if we hit this situation we just PANIC.

I'm not sure I really believe this. If someone tries to configure a
backup without inserting a non-default setting of
recovery_target_timeline, is it more likely that they want backup
restoration to fail, or that they want to recover from the timeline
that will let backup restoration succeed? You're arguing for the
former, but my instinct was the latter. Perhaps we need to hear some
other opinions.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2020-07-01 20:09:35 Re: POC: rational number type (fractions)
Previous Message Stephen Frost 2020-07-01 20:02:18 Re: v12 and TimeLine switches and backups/restores