Re: pg_upgrade failing for 200+ million Large Objects
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Jacob Champion <jchampion@timescale.com>
Cc: Jan Wieck <jan@wi3ck.info>, Tom Lane <tgl@sss.pgh.pa.us>, Bruce Momjian <bruce@momjian.us>, Zhihong Yu <zyu@yugabyte.com>, Andrew Dunstan <andrew@dunslane.net>, Magnus Hagander <magnus@hagander.net>, Robins Tharakan <tharakan@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-09-08T23:18:07Z
Lists: pgsql-hackers
On Wed, Sep 07, 2022 at 02:42:05PM -0700, Jacob Champion wrote: > Just to clarify, was Justin's statement upthread (that the XID problem > is fixed) correct? And is this patch just trying to improve the > remaining memory and lock usage problems? I think "fixed" might not be totally accurate, but that is the gist. > I took a quick look at the pg_upgrade diffs. I agree with Jan that the > escaping problem is a pretty bad smell, but even putting that aside for > a bit, is it safe to expose arbitrary options to pg_dump/restore during > upgrade? It's super flexible, but I can imagine that some of those flags > might really mess up the new cluster... > > And yeah, if you choose to do that then you get to keep both pieces, I > guess, but I like that pg_upgrade tries to be (IMO) fairly bulletproof. IIUC the main benefit of this approach is that it isn't dependent on binary-upgrade mode, which seems to be a goal based on the discussion upthread [0]. I think it'd be easily possible to fix only pg_upgrade by simply dumping and restoring pg_largeobject_metadata, as Andres suggested in 2018 [1]. In fact, it seems like it ought to be possible to just copy pg_largeobject_metadata's files as was done before 12a53c7. AFAICT this would only work for clusters upgrading from v12 and newer, and it'd break if any of the underlying data types change their storage format. This seems unlikely for OIDs, but there is ongoing discussion about changing aclitem. I still think this is a problem worth fixing, but it's not yet clear how to proceed. [0] https://postgr.es/m/227228.1616259220%40sss.pgh.pa.us [1] https://postgr.es/m/20181122001415.ef5bncxqin2y3esb%40alap3.anarazel.de -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Count individual SQL commands in pg_restore's --transaction-size mode.
- 81db073a2878 17.0 landed
- 0f1290521504 18.0 landed
-
Reduce number of commands dumpTableSchema emits for binary upgrade.
- b3f0e0503f33 18.0 landed
- 2fa989e6a340 17.0 landed
-
Invent --transaction-size option for pg_restore.
- 959b38d770ba 17.0 landed
-
Rearrange pg_dump's handling of large objects for better efficiency.
- a45c78e3284b 17.0 landed
-
Add temporal PRIMARY KEY and UNIQUE constraints
- 46a0cd4cefb4 17.0 cited
-
Fix typo and case in messages
- 7d7ef075d2b3 17.0 cited