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 1mJInH-0002sg-Hh for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Aug 2021 17:03:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJInG-0006K4-1e for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Aug 2021 17:03:58 +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 1mJInF-0006Jw-OA for pgsql-hackers@lists.postgresql.org; Thu, 26 Aug 2021 17:03:57 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJInD-0001Lb-GK for pgsql-hackers@postgresql.org; Thu, 26 Aug 2021 17:03:57 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id BFB075F799; Thu, 26 Aug 2021 13:03:54 -0400 (EDT) Date: Thu, 26 Aug 2021 13:03:54 -0400 From: Stephen Frost To: Bruce Momjian Cc: Robert Haas , Tom Lane , Shruthi Gowda , Andres Freund , Alvaro Herrera , Masahiko Sawada , Tom Kincaid , Amit Kapila , Thomas Munro , PostgreSQL Development , Masahiko Sawada Subject: Re: preserving db/ts/relfilenode OIDs across pg_upgrade (was Re: storing an explicit nonce) Message-ID: <20210826170354.GF17906@tamriel.snowman.net> References: <1230173.1629218575@sss.pgh.pa.us> <1366142.1629222880@sss.pgh.pa.us> <20210826152437.GA28178@momjian.us> <20210826153651.GB17906@tamriel.snowman.net> <20210826154840.GF22637@momjian.us> <20210826163456.GD17906@tamriel.snowman.net> <20210826164959.GG22637@momjian.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gpD07/c6JxvXcqO5" Content-Disposition: inline In-Reply-To: <20210826164959.GG22637@momjian.us> 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 --gpD07/c6JxvXcqO5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Bruce Momjian (bruce@momjian.us) wrote: > On Thu, Aug 26, 2021 at 12:34:56PM -0400, Stephen Frost wrote: > > * Bruce Momjian (bruce@momjian.us) wrote: > > > On Thu, Aug 26, 2021 at 11:36:51AM -0400, Stephen Frost wrote: > > > > * Bruce Momjian (bruce@momjian.us) wrote: > > > > > On Thu, Aug 26, 2021 at 11:00:47AM -0400, Robert Haas wrote: > > > > > > Anyone see a flaw in that analysis? > > > > >=20 > > > > > I am still waiting to hear the purpose of this preservation. As = long as > > > > > you don't apply the patch, I guess I will just stop asking. > > > >=20 > > > > I'm a bit confused why this question keeps coming up as we've discu= ssed > > > > multiple reasons (incremental backups, possible use for TDE which w= ould > > >=20 > > > I have not seen much explaination on pgBackRest, except me mentioning > > > it. Is this something really useful? > >=20 > > Being able to quickly perform a backup on a newly upgraded cluster would > > certainly be valuable and that's definitely not possible today due to > > all of the filenames changing. >=20 > You mean incremental backup, right? I was told this by the pgBackRest > developers during PGCon, but I have not heard that stated publicly, so I > hate to go just on what I heard rather than seeing that stated publicly. Yes, we're talking about either incremental (or perhaps differential) backup where only the files which are actually different would be backed up. Just like with PG, I can't provide any complete guarantees that we'd be able to actually make this possible after a major version with pgBackRest with this change, but it definitely isn't possible *without* this change. I can't see any reason why we wouldn't be able to do a checksum-based incremental backup though (which would be *much* faster than a regular backup) once this change is made and have that be a reliable and trustworthy backup. I'd want to think about it more and discuss it with David in some detail before saying if we could maybe perform a timestamp-based incremental backup (without checksum'ing the files, as we do in normal situations), but that would really just be a bonus. > > > As far as TDE, I haven't seen any concrete plan for that, so why add > > > this code for that reason? > >=20 > > That this would help with TDE (of which there seems little doubt...) is > > an additional benefit to this. Specifically, taking the existing work > > that's already been done to allow block-by-block encryption and > > adjusting it for AES-XTS and then using the db-dir+relfileno+block > > number as the IV, just like many disk encryption systems do, avoids the > > concerns that were brought up about using LSN for the IV with CTR and > > it's certainly not difficult to do, but it does depend on this change. > > This was all discussed previously and it sure looks like a sensible > > approach to use that mirrors what many other systems already do > > successfully. >=20 > Well, I would think we would not add this for TDE until we were sure > someone was working on adding TDE. That this would help with TDE is what I'd consider an added bonus. > > > > make this required, general improved sanity when working with pg_up= grade > > > > is frankly a benefit in its own right too...). If the additional c= ode > > >=20 > > > How? I am not aware of any advantage except cosmetic. > >=20 > > Having to resort to matching up inode numbers between the two clusters > > after a pg_upgrade to figure out what files are actually the same > > underneath is a pain that goes beyond just cosmetics imv. Removing that > > additional level that admins, and developers for that matter, have to go > > through would be a nice improvement on its own. >=20 > OK, I was just not aware anyone did that, since I have never hard anyone > complain about it before. I've certainly done it and I'd be kind of surprised if others haven't, but I've also played a lot with pg_dump in various modes, so perhaps that's not a great representation. I've definitely had to explain to clients why there's a whole different set of filenames after a pg_upgrade and why that is the case for an 'in place' upgrade before too. > > > > was a huge burden or even a moderate one then that might be an argu= ment > > > > against, but it hardly sounds like it will be given Robert's thorou= gh > > > > analysis so far and the (admittedly not complete, but not that far = =66rom > > > > it based on the DB OID review) proposed patch. > > >=20 > > > I am find to add it if it is minor, but I want to see the calculus of > > > its value vs complexity, which I have not seen spelled out. > >=20 > > I feel that this, along with the prior discussions, spells it out > > sufficiently given the patch's complexity looks to be reasonably minor > > and very similar to the existing things that pg_upgrade already does. > > Had pg_upgrade done this in the first place, I don't think there would > > have been nearly this amount of discussion about it. >=20 > Well, there is a reason pg_upgrade didn't initially do this --- because > it adds complexity, and potentially makes future changes to pg_upgrade > necessary if the server behavior changes. I have a very hard time seeing what changes might happen in the server in this space that wouldn't have an impact on pg_upgrade, with or without this. > I am not saying this change is wrong, but I think the reasons need to be > stated in this thread, rather than just moving forward. Ok, they've been stated and it seems to at least Robert and myself that this is worthwhile to at least continue through to a concluded patch, after which we can contemplate that patch's complexity against these reasons. Thanks, Stephen --gpD07/c6JxvXcqO5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJhJ8l6AAoJEO1sijiDR2RVTCIP/3vHqA8Z7Zci7Y9+y/nuWT1h ul9lDGIeLkT+YsQmXfNcEj+synO5hxbFKZqUL9IRR+1DBbQymREWRFjdjDiUEqKY XmpLT61mzhWno+T5ei8+P9+c0RFYDmymhVkS43/A9yVTun7rPiE9ZID5YE81Og3P kmr7pKqUAivLIlIDFfFeeaAuuzTFZ+tYyHu51vYkcy5+baP9UxRlRcdceoBya/zO 8mEl9HFXGNxIA7ixkVUD+cqATFDkBXUFuHnvmerEgPb4sdAaRD1EwPJTx9HW4zG0 OhOqPdHBovwOPdTA+HDYMziByhQyNI+d0hGKx5iTV4YjGrPnFWmsNPeF8/sj195k 0We4kII4l/CYU9zuyxb1G4QixALVW09Hkvf/zo0qQqok3rRwFy6tUgqw1zfsHoSe Xp57lVT4U33gO83e1YJIjkLeGPnAMB1kdq+bnyQFsilATuPlAJFrUBsMBMwrsYvf vuHQzVlh9ofpKe/cM6vFqjIxMThLln+lHC69CDxmneRRnGVchjzqC/MBjByli1vs b317OZ6E6mJ1u/MlYPUuL7aSNt7VC6VcSrcQv12teaxvToebsDt2gTppKUdOOf+7 kRC+TCKkbcvMMK3gExa2yLYITIDLhGl1/9ore4CdnMCCiEO128EXBAR0oBJrtgyC Upzqx9Nyg+C93rEXw+uX =vwyu -----END PGP SIGNATURE----- --gpD07/c6JxvXcqO5--