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 1n9uZX-0002Ol-47 for pgsql-general@arkaria.postgresql.org; Tue, 18 Jan 2022 19:55:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9uZV-0007Zy-Id for pgsql-general@arkaria.postgresql.org; Tue, 18 Jan 2022 19:55:13 +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 1n9uZV-0007Zo-7C for pgsql-general@lists.postgresql.org; Tue, 18 Jan 2022 19:55:13 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9uZS-0001Me-B5 for pgsql-general@lists.postgresql.org; Tue, 18 Jan 2022 19:55:12 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id E268C5F79F; Tue, 18 Jan 2022 14:55:08 -0500 (EST) Date: Tue, 18 Jan 2022 14:55:08 -0500 From: Stephen Frost To: "David G. Johnston" Cc: Issa Gorissen , Torsten =?iso-8859-1?Q?F=F6rtsch?= , pgsql-general Subject: Re: WAL Archiving and base backup Message-ID: <20220118195508.GE10577@tamriel.snowman.net> References: <164bc278-a4cd-f7cf-613b-e1c94aa63e56@usa.net> <1d73a885-1c78-eec5-fbc6-fe5e0f621e5f@usa.net> <20220114183144.GA10577@tamriel.snowman.net> <20220118175303.GD10577@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="C94crkcyjafcjHxo" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --C94crkcyjafcjHxo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * David G. Johnston (david.g.johnston@gmail.com) wrote: > On Tue, Jan 18, 2022 at 10:53 AM Stephen Frost wrote: > > We already have pg_receivewal, which is part of pg_basebackup, and is > > able to use a slot and such. I'm not sure that making pg_basebackup > > somehow also work as an archive command makes much sense >=20 > I suppose my proposal should have been: >=20 > Create and document a new "PostgreSQL Server Application" [1] and name it: > pg_archive_wal > Advise people to set their archive_command to "pg_archive_wal > --path=3D/location/of/archive %p/%f >=20 > 1. https://www.postgresql.org/docs/current/reference-server.html Or just link to a proper solution that already exists and includes support for object stores, multiple repositories, checksums all files and stores them in a manifest to validate them ... > Having pg_basebackup still prompt for permission to add that command to t= he > system via ALTER SYSTEM (probably will some other logic) seems doable. It doesn't seem to follow, to me anyway, that if you're using pg_basebackup that you'd want to use this proposed pg_archive_wal. Much more likely would be that you'd want to use pg_receivewal, which doesn't need any archive command to be set. Seems like a feature in need of a use case is what I'm getting at here. > Having created a base backup one still must decide on a wal archiving > strategy. There appear to be two options, though as far as I can tell if > one simply reads the documentation regarding backups they will not discov= er > the pg_receivewal option. I, not knowing of that option myself, have been > operating under the assumption that if one uses pg_basebackup that one > would be required to setup an archive_command as well. Adding a reference to pg_receivewal under the continuous archiving section would probably make sense, similar to how pg_basebackup is referenced from the base backup section. Might even make sense to have a 'low level API' section for WAL archiving which mentions archive_command ... or maybe not and rip out the existing 'low level API' section as it really isn't nearly detailed enough for someone to be able to write a proper tool and having it there implies that it does provide that. > The superior option is having a persistently running pg_receivewal command > on a server. As noted above, the documentation does not do this option > justice. Not sure that I'd say that it's the superior option, but it depends on the options that are being considered and if you're limiting those to "just what exists in core." > The alternative option is to set archive_command; which at present is also > poorly documented. My proposal above simply tries to improve on this. A= nd > while that is a good and easy starting point if there is agreement on > pg_receivewal being a superior archiving option (leaving archive_command > unset) reworking the documentation to guide the inexperience PostgreSQL D= BA > toward a "minimal but effective" backup procedure is needed. Adding a new PG server application isn't exactly what I'd call just a simple improvement to the documentation ... The existing documentation for base backups does, in fact, link to pg_basebackup to guide the new DBA to a solution for base backups that's minimal but effective. Doing PITR is getting beyond just the minimal, but even so, linking to pg_receivewal in a similar manner probably does make sense since we link to pg_basebackup, so I think I agree with you about that specific change. Hopefully, we can remove the long deprecated exclusive backup option and further simplify the backup documentation. Thanks, Stephen --C94crkcyjafcjHxo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJh5xscAAoJEO1sijiDR2RVT/EP/2vvGUWSnc7AZiFexDYqt4O2 XOXbMwSJVIfIw6YyaZIQKzRcI3fY1sFV8b6nnGDM/16jimuxFMm79Q/s9nchi7d4 DA0UxNfY4K3RMjr/7o1IuqjTDnQUrZor6DYedq0tfvzuCCXLWNwssvISTWn5PaLB Zps1xqNW20zISMWK9P8l09lfNCKYXZ3GaTur3tUimP5iCkLYsIly/Azaz4qKR9LQ 6nO5aCNqiRBy/xAeFibPUmlXcb+b8354Ad7DjTriEnAr0HSy27Cb+qosFg2o4ZX2 s90T3c8dxUeF3rIQvbzPLQlXMDU0kYLZTBDTUr7geCPPiIbZyl0lcax1TSQa8XuO uiiqYJqV9DkRKOh+uJxqp/IPXTcWZaZpYxj33RLoatIOb6wp8EfliR1GXSQu09aE dRr9FtHRmWz3Nh6PxLo14Dtizitf5iXzZ/aNvDzkzQ0WcyFUhuLaoc8B1CSn0EYk 5i8unGcGl/DocAQZ4z4NxAOO+ciyLFJ34DSIbhqV4Sn6kmFZ7QQDWHy4PxhM/N7T qizO/KBRipvmB25HLzpuBcTITKrIm1/NNfvvEl7Q7hY9BMjo3a5mfhgWub4Xz+2L IQs4D8tW0/13S/sivH54tAwoN4E6jftdvO20JAI4QfTfVU2uEooosXzlm0Pk/8E5 FJ1MW0KNC/62o3xYOXE1 =8cIY -----END PGP SIGNATURE----- --C94crkcyjafcjHxo--