Re: pg_basebackup + incremental base backups

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Christopher Pereira <kripper(at)imatronix(dot)cl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_basebackup + incremental base backups
Date: 2020-05-21 12:43:03
Message-ID: 20200521124303.GV3418@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

* Christopher Pereira (kripper(at)imatronix(dot)cl) wrote:
> >>In case of big databases, can we do incremental backups with pg_basebackup?
> >pg_basebackup doesn't support incremental backups, though there's been
> >discussion of adding some kind of support for it, check -hackers if
> >you're curious.
> >
> >>Is there any alternative?
> >There's a few different alternatives for PG backup software, some of
> >which support incremental backups and restores. I'm personally involved
> >with pgbackrest- https://pgbackrest.org though there's other options out
> >there also (wal-g, barman, and more).
>
> We tried pgbackrest as a solution to rebuild the standby cluster, by making
> a differential backup of the primary cluster.
>
> But it seems that pgbackrest is only able to rebuild the standby cluster by
> restoring an existing backup from a repository cluster, and not directly
> from the primary cluster.

Yes, pgbackrest is a full solution for backups, not just a clone sync
tool.

> We are afraid that creating a backup on the repository cluster is an
> additional step that could be avoided.

Ideally you'd be taking regular backups and therefore would have one to
use to perform the restore (or delta restore if you're trying to catch
up a replica that's fallen behind). Note that with pgbackrest, you
don't need to take a *new* backup, if you're already using it for your
regular backups- just do a delta restore and pgbackrest will
automatically pick the latest backup (of whatever type) and will restore
using it.

> Is there some way to rebuild the standby cluster by doing a differential
> backup of the primary cluster directly?

We've contemplated adding support for something like this to pgbackrest,
since all the pieces are there, but there hasn't been a lot of demand
for it and it kind of goes against the idea of having a proper backup
solution, really.. It'd also create quite a bit of load on the primary
to checksum all the files to do the comparison against what's on the
replica that you're trying to update, so not something you'd probably
want to do a lot more than necessary.

Thanks,

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message postgann2020 s 2020-05-21 14:18:03 Suggestion on table analyze
Previous Message Andrus 2020-05-21 06:09:44 Re: How to recover from compressed wal archieve in windows