Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbkXe-0005V5-1r for pgsql-general@arkaria.postgresql.org; Thu, 21 May 2020 12:43:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbkXb-0005rP-CJ for pgsql-general@arkaria.postgresql.org; Thu, 21 May 2020 12:43:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbkXb-0005rG-3Y for pgsql-general@lists.postgresql.org; Thu, 21 May 2020 12:43:15 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbkXS-00017u-DH for pgsql-general@postgresql.org; Thu, 21 May 2020 12:43:13 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id F1C0C5F79E; Thu, 21 May 2020 08:43:03 -0400 (EDT) Date: Thu, 21 May 2020 08:43:03 -0400 From: Stephen Frost To: Christopher Pereira Cc: pgsql-general@postgresql.org Subject: Re: pg_basebackup + incremental base backups Message-ID: <20200521124303.GV3418@tamriel.snowman.net> References: <514b14cb-f0b8-157b-2755-d5170ed4d24b@imatronix.cl> <20191204030907.GB6962@tamriel.snowman.net> <367ee69d-9dc7-4de6-f8a1-b460567bcc07@imatronix.cl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ln+iIw7POnzHEEo5" Content-Disposition: inline In-Reply-To: <367ee69d-9dc7-4de6-f8a1-b460567bcc07@imatronix.cl> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Ln+iIw7POnzHEEo5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Christopher Pereira (kripper@imatronix.cl) wrote: > >>In case of big databases, can we do incremental backups with pg_basebac= kup? > >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). >=20 > We tried pgbackrest as a solution to rebuild the standby cluster, by maki= ng > a differential backup of the primary cluster. >=20 > 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 --Ln+iIw7POnzHEEo5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJexndXAAoJEO1sijiDR2RVpJEP/3yUml4HNVlmjwc0tsZeQzp3 RBRUvviqtUZYiL6AjjuP5NuU+E92QRuZsbROC45FojHAEznO2ZncPAUSShAC4Y3E OGnJggw/8p+WJ3J0fgOMN1Tqybmo68HML3wZEAxU4lDh18TLlXb2pUTTWIqw9UVt g3SmZDW2cuiwzecDkTh2RGK4ZWzgB/22gwj6W6jbqvJ+NKhtQd+KUYaToW00IoLy eTMjzNkTiqi1UTg4Qs0zTxZQJcAH6lrEEO3eUsgPzZkmsuzqgK3K0n7O4x52jDNW yuZCq9xLIDGzJscpAjF+9ZXpxDQMw38HJAnsapzFFDYBcLgniElo2krq76DKhQUB RW1+CuPYkgGyqmlojhEnQ5u2LIoYm/Chc/u3MypSA5ZSMOg1RVLFq+4ajCfABiNr VO9vxU4kSO6nPGIdJRuy8WYNJJhMo5e9e8ne59opGFtMEMr1YMoU3oc1iEsBGpgK TDW/GJvlJxrmGOopKq3mW2yZTb2D/peZQ5ioMHC6X4C7M+oW4Vr+60HVeemqFW6M qY7Z3v78uWJHnVzy93EPpbFakU6N7txNOux9Xp9hZcuPbM61uxOAsLL1s90iaX8U lV8HBYDKzxhXJZg24tu5OsWKUwvAHh6wAfj9GseAjFIxzzohatIps6ZYmSV7RVkj CY1HFA2fO5sN+KFKvWTd =k7SM -----END PGP SIGNATURE----- --Ln+iIw7POnzHEEo5--