Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKpdB-0005kx-8x for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jun 2017 17:29:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dKpdA-00006F-Rc for pgsql-committers@arkaria.postgresql.org; Tue, 13 Jun 2017 17:29:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dKpcw-0007st-45 for pgsql-committers@postgresql.org; Tue, 13 Jun 2017 17:29:14 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dKpcs-00088P-LC for pgsql-committers@postgresql.org; Tue, 13 Jun 2017 17:29:13 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1dKpcr-0006du-6P; Tue, 13 Jun 2017 13:29:09 -0400 Date: Tue, 13 Jun 2017 13:29:09 -0400 From: Bruce Momjian To: Tom Lane Cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Assert that we don't invent relfilenodes or type OIDs in binary Message-ID: <20170613172909.GJ13873@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Uh, is there a reason this is only an Assert(), meaning it only checks in assert builds. pg_upgrade already has a lot of checks and they are all fatal. --------------------------------------------------------------------------- On Tue, Jun 13, 2017 at 12:04:48AM +0000, Tom Lane wrote: > Assert that we don't invent relfilenodes or type OIDs in binary upgrade. > > During pg_upgrade's restore run, all relfilenode choices should be > overridden by commands in the dump script. If we ever find ourselves > choosing a relfilenode in the ordinary way, someone blew it. Likewise for > pg_type OIDs. Since pg_upgrade might well succeed anyway, if there happens > not to be a conflict during the regression test run, we need assertions > here to keep us on the straight and narrow. > > We might someday be able to remove the assertion in GetNewRelFileNode, > if pg_upgrade is rewritten to remove its assumption that old and new > relfilenodes always match. But it's hard to see how to get rid of the > pg_type OID constraint, since those OIDs are embedded in user tables > in some cases. > > Back-patch as far as 9.5, because of the risk of back-patches breaking > something here even if it works in HEAD. I'd prefer to go back further, > but 9.4 fails both assertions due to get_rel_infos()'s use of a temporary > table. We can't use the later-branch solution of a CTE for compatibility > reasons (cf commit 5d16332e9), and it doesn't seem worth inventing some > other way to do the query. (I did check, by dint of changing the Asserts > to elog(WARNING), that there are no other cases of unwanted OID assignments > during 9.4's regression test run.) > > Discussion: https://postgr.es/m/19785.1497215827@sss.pgh.pa.us > > Branch > ------ > REL9_6_STABLE > > Details > ------- > https://git.postgresql.org/pg/commitdiff/318fd99ce7e775158c87b8515780f2663d2df429 > > Modified Files > -------------- > src/backend/catalog/catalog.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > > -- > Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-committers -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers