Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP8ao-0007Rg-3q for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Dec 2017 15:05:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eP8an-0003gq-Lq for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Dec 2017 15:05:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eP8an-0003gf-C9 for pgsql-hackers@lists.postgresql.org; Wed, 13 Dec 2017 15:05:05 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eP8ag-00018R-4G for pgsql-hackers@postgresql.org; Wed, 13 Dec 2017 15:05:03 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 3FAC65F795; Wed, 13 Dec 2017 10:04:57 -0500 (EST) Date: Wed, 13 Dec 2017 10:04:57 -0500 From: Stephen Frost To: David Steele Cc: Andres Freund , PostgreSQL-development , Michael Paquier Subject: Re: PATCH: Exclude unlogged tables from base backups Message-ID: <20171213150456.GI4628@tamriel.snowman.net> References: <04791bab-cb04-ba43-e9c0-664a4c1ffb2c@pgmasters.net> <20171212225234.jqdwd4sp663l4znp@alap3.anarazel.de> <5e428ad7-f37f-6479-aabf-2c8b9318fb79@pgmasters.net> <20171212230740.evr7rvkzz5bztdg6@alap3.anarazel.de> <20171213014804.GH4628@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="j7mZoF2g8/LUeOy5" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --j7mZoF2g8/LUeOy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable David, * David Steele (david@pgmasters.net) wrote: > On 12/12/17 8:48 PM, Stephen Frost wrote: > > I don't think there is, because, as David points out, the unlogged > > tables are cleaned up first and then WAL replay happens during recovery, > > so the init fork will cause the relation to be overwritten, but then > > later the logged 'drop table' and subsequent re-use of the relfilenode > > to create a new table (or persistence change) will all be in the WAL and > > will be replayed over top and will take care of this. >=20 > Files can be copied in any order, so if an OID is recycled the backup > could copy its first, second, or nth incarnation. It doesn't really > matter since all of it will be clobbered by WAL replay. >=20 > The new base backup code just does the non-init fork removal in advance, > following the same rules that would apply on recovery given the same > file set. Just to be clear- the new base backup code doesn't actually *do* the non-init fork removal, it simply doesn't include the non-init fork in the backup when there is an init fork, right? We certainly wouldn't want a basebackup actually running around removing the main fork for unlogged tables on a running and otherwise healthy system. ;) Thanks! Stephen --j7mZoF2g8/LUeOy5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaMUGYAAoJEO1sijiDR2RV9cgP/34cwQQLk8a02o7sEf0yCSZf NWS+dF69bDe2XKapVowxosPb3+lnbxx4q4DdwAEUFl1biHF4L9XcXRj0G12wxK/C WrVfzfbqqigSMB/VXMpezMDk93KVSZ6W2xCnmnHdobhiAWIZ62tGklyJHKZ1p0NG dhHUW+KTk1VMnUG69xgb85zSzSZ4hIwtakJdDjVFUz3+6sJLbDnNyM6/LaEbuJZB CXHmpMO9DWVhK/OtPCPqogwqmHsf38mvBMKyfkDm9d7GOj5B6m84Z6VYE3C5gHnX 8ckrfuKXJJnAn2EBljwsWUxwqWuWXTB/pgXLfGQ7KgwnqLXvKScoWFzvG8xUmTGP jKzoa35g4VALA/BnSq9cAkxL8f0YaxNp2sTgMxb+4USh+b7QIQqQP8kow5Caf2u7 Xp+D7ddqW4xdK0/L2nfHIHggfa7ZcDJ6HxnutqKIsJKCdsA3i9u/GIqPNWbJ/Fcf pzYBNN/jPsqLixAhmijJMlSce5Ex9iF8hvFKjObhdM0lAIKzHtuGV3LS1UMNqEed 1YIf717gZWpHPbDrpylAlPDGj2Le4Uu/mnB/oV1vfTv23SPvnCWJ7e09SNHAmz2T 3e/WB6lrb8DGCbGuBVPuvhI4ekkkeaWfEx6eNLC1DEkDITQTsd/lqB2LWd3u5jGD DCzzbN4QA8b2PjyAFX8n =ueB1 -----END PGP SIGNATURE----- --j7mZoF2g8/LUeOy5--