Re: Incremental backup from a streaming replication standby fails - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Incremental backup from a streaming replication standby fails
Date
Msg-id CA+TgmobigpSed3tMqRkA16-wFCHgf4kSMrDmpiSVmKmz9YhQNQ@mail.gmail.com
Whole thread Raw
In response to Re: Incremental backup from a streaming replication standby fails  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Incremental backup from a streaming replication standby fails
List pgsql-hackers
On Wed, Jul 24, 2024 at 6:46 AM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>   An incremental backup is only possible if replay would begin from a later
>   checkpoint than the checkpoint that started the previous backup upon which
>   it depends.

My concern here is that the previous backup might have been taken on a
standby, and therefore it did not start with a checkpoint. For a
standby backup, replay will begin from a checkpoint record, but that
record may be quite a bit earlier in the WAL. For instance, imagine
checkpoint_timeout is set to 30 minutes on the standby. When the
backup is taken, the most recent restartpoint could be up to 30
minutes ago -- and it is the checkpoint record for that restartpoint
from which replay will begin. I think that in my phrasing, it's always
about the checkpoint from which replay would begin (which is always
well-defined) not the checkpoint that started the backup (which is
only logical on the primary).

>  If you take the incremental backup on the primary, this
>   condition is always satisfied, because each backup triggers a new
>   checkpoint.  On a standby, replay begins from the most recent restartpoint.
>   Therefore, an incremental backup of a standby server can fail if there has
>   been very little activity since the previous backup, since no new
>   restartpoint might have been created.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: CI, macports, darwin version problems
Next
From: Heikki Linnakangas
Date:
Subject: Re: Regarding t_cid in Neon heap WAL records