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 1oWQmp-0007DI-VT for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 23:18:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oWQmo-0006JK-KE for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2022 23:18:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWQmo-0006JB-8l for pgsql-hackers@lists.postgresql.org; Thu, 08 Sep 2022 23:18:18 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oWQmh-0002t1-Nx for pgsql-hackers@postgresql.org; Thu, 08 Sep 2022 23:18:17 +0000 Received: by mail-pj1-x1030.google.com with SMTP id p1-20020a17090a2d8100b0020040a3f75eso4007301pjd.4 for ; Thu, 08 Sep 2022 16:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=sYHG+fUJIh2FhJkSm9Ecu6KeBtQVXqXeTgUoFp0VAZE=; b=YtZ1/1kVe6irVRu+fD4wJkGeIHJE35bjzQ8VVIgloMWzFMosNkcGDObzqxOEQEqeqD di5ypcnxVV3Y7k6WAH7BV+XnSTJAmIX+4Pber4OH+73XaTUANiR73Qs4JYPmn0oI6ieA aIH9kDabZvaW+2GQDwq7newlerFRhXazvIxrjgiVrRgvJnjZB169VLobHbrH83hjzP6S 7fJQKrAvvSm/djSWlfAclTe3eWOjAoYvRFVUv5uAD8iuPNAHHbnTzj89Ybasl327Y3MT 9Ds6gNx457t9mO8OSts4r4TyvHVZtPxyjgvXljmOdZ/bg78wLsTj3r4O5YsxHgXzI2lv l0TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=sYHG+fUJIh2FhJkSm9Ecu6KeBtQVXqXeTgUoFp0VAZE=; b=0HeQ8RPtjfijW9ylFdONb0wyTjJe2EsRcDdKur9PRQ14sN1eqRDr6D8BI6K7UKTQX2 /eLAiQ9J/ZQKSwpAuFO8U2vh2ldlGBK+eDNDUg8Md2+oel4DcxE9RL/mZLzk47Sfqtz2 bXSmKdDDFA0JlKH1mhq2r6D8RL9dZ6Yc5MmK3ybgks8QmfbKRUvFq00HvII1fHC/4Pug 5CoNoauwXnJX+w1BxVVHr/+Du79s+qv3zgElidjtXvezT9V+tVg6NsmHLqlT6Xybz9pt lbes8uxT2mAi5TywHv3u9ztmTEceld8PNFhcFf7YpYBK7Z3NeJGXsq7+OnMkLfnPg5xF 42AQ== X-Gm-Message-State: ACgBeo1q/69ckVQKhTtw7xYbA/6kxRfmpEvoQNHFFgk0LPfjNk2lNNFe rrXREJ0mIkSm3HxeAbKXa8A= X-Google-Smtp-Source: AA6agR7bS7gLUxJI6foJaGLmiXcMqdOFMGqpOs9XFqnOES7KRtAZpEpR/8NlBdb+mXzHdWcjOVPNfA== X-Received: by 2002:a17:90b:4c8d:b0:1f5:29ef:4a36 with SMTP id my13-20020a17090b4c8d00b001f529ef4a36mr6673286pjb.127.1662679090576; Thu, 08 Sep 2022 16:18:10 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id x4-20020a17090ad68400b001fbb6d73da5sm106353pju.21.2022.09.08.16.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 16:18:10 -0700 (PDT) Date: Thu, 8 Sep 2022 16:18:07 -0700 From: Nathan Bossart To: Jacob Champion Cc: Jan Wieck , Tom Lane , Bruce Momjian , Zhihong Yu , Andrew Dunstan , Magnus Hagander , Robins Tharakan , Peter Eisentraut , "pgsql-hackers@postgresql.org" Subject: Re: pg_upgrade failing for 200+ million Large Objects Message-ID: <20220908231807.GA2242918@nathanxps13> References: <986904.1616525964@sss.pgh.pa.us> <6cccaa33-c263-b8a2-b064-985605d33d25@wi3ck.info> <988415.1616528159@sss.pgh.pa.us> <872315a8-99fc-da4e-463d-784cfb5a025d@wi3ck.info> <1010642.1616532950@sss.pgh.pa.us> <802b96e9-f5e1-015c-dfb9-8756974b11fc@wi3ck.info> <0263bf35-05d6-02a1-519b-b7895a918314@wi3ck.info> <20220825003227.GA1456581@nathanxps13> <663393ca-b2ff-26f0-2e2d-adc942aff4fd@timescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <663393ca-b2ff-26f0-2e2d-adc942aff4fd@timescale.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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