From: Nishant, Fnu <nishantf@amazon.com>
To: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nasby, Jim <nasbyj@amazon.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Jeremy Finzel <finzelj@gmail.com>
Subject: Re: found xmin from before relfrozenxid on pg_catalog.pg_authid
Date: Mon, 28 May 2018 15:07:52 +0000
Message-ID: <5AA972C7-DF64-4EAF-8828-A21AE05E18CB@amazon.com> (raw)
In-Reply-To: <20180527200006.hbwa2h7nfuunmnza@alap3.anarazel.de>
References: <20180524205820.quhhnn3n2ag5yryb@alap3.anarazel.de>
<20180524211311.tnswfnjwnii54htx@alvherre.pgsql>
<20180525203736.crkbg36muzxrjj5e@alap3.anarazel.de>
<15665.1527284857@sss.pgh.pa.us>
<20180525220531.43ia22l2d3jspbng@alap3.anarazel.de>
<20180526204506.ql5pesq6t2jbpuy5@alap3.anarazel.de>
<842C9FB7-B9FB-43B9-AF28-9C5324F23ED8@amazon.com>
<D670D841-C88B-4D28-B852-16ABBDBA5F88@anarazel.de>
<10046.1527441741@sss.pgh.pa.us>
<20180527200006.hbwa2h7nfuunmnza@alap3.anarazel.de>
Hi,
We were working on this issue and thinking if we could actually make pg_class(rd_rel) part of recache entry upgradable.
To achieve this we can allocate Form_pg_class structures (for shared relations… a small number) on shared memory.
We do not need global pg_internal_init file as new backend during boot up will be set to point at already stored Form_pg_class structure.
Thanks,
Nishant
On 5/27/18, 1:01 PM, "Andres Freund" <andres@anarazel.de> wrote:
Hi,
On 2018-05-27 13:22:21 -0400, Tom Lane wrote:
> But I don't think there's any need for special magic here: we just
> have to accept the fact that there's a need to flush that cache
> sometimes. In normal use it shouldn't happen often enough to be a
> performance problem.
Yea, it's not that problematic. We already remove the local init
file. I started out trying to write a version of invalidation that also
WAL logs shared inval, but that turns out to be hard to do without
breaking compatibilty. So I think we should just always unlink the
shared one - that seems to work well.
> FWIW, I'm not on board with "memcpy the whole row". I think the right
> thing is more like what we do in RelationReloadIndexInfo, ie copy over
> the specific fields that we expect to be mutable.
But that's what RelationReloadIndexInfo() etc do?
relp = (Form_pg_class) GETSTRUCT(pg_class_tuple);
memcpy(relation->rd_rel, relp, CLASS_TUPLE_SIZE);
I don't think we need to modify anything outside of rd_rel at this
point?
I've a patch that seems to work, that mostly needs some comment
polishing.
Greetings,
Andres Freund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: nishantf@amazon.com, andres@anarazel.de, tgl@sss.pgh.pa.us, nasbyj@amazon.com, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org, maxim.boguk@gmail.com, pg@bowt.ie, finzelj@gmail.com
Subject: Re: found xmin from before relfrozenxid on pg_catalog.pg_authid
In-Reply-To: <5AA972C7-DF64-4EAF-8828-A21AE05E18CB@amazon.com>
References: <20180524205820.quhhnn3n2ag5yryb@alap3.anarazel.de> <20180524211311.tnswfnjwnii54htx@alvherre.pgsql> <20180525203736.crkbg36muzxrjj5e@alap3.anarazel.de> <15665.1527284857@sss.pgh.pa.us> <20180525220531.43ia22l2d3jspbng@alap3.anarazel.de> <20180526204506.ql5pesq6t2jbpuy5@alap3.anarazel.de> <842C9FB7-B9FB-43B9-AF28-9C5324F23ED8@amazon.com> <D670D841-C88B-4D28-B852-16ABBDBA5F88@anarazel.de> <10046.1527441741@sss.pgh.pa.us> <20180527200006.hbwa2h7nfuunmnza@alap3.anarazel.de> <5AA972C7-DF64-4EAF-8828-A21AE05E18CB@amazon.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox