Re: [COMMITTERS] pgsql: Add support for coordinating record typmods among parallel worke - Mailing list pgsql-committers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Add support for coordinating record typmods among parallel worke
Date
Msg-id 31856.1505502434@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke  (Andres Freund <andres@anarazel.de>)
Responses Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke  (Andres Freund <andres@anarazel.de>)
Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-committers
Andres Freund <andres@anarazel.de> writes:
> On 2017-09-15 10:33:37 -0400, Tom Lane wrote:
>> I don't much like your proposed comment; the only way that this code
>> is even approximately correct is if we're exiting the process and
>> will never touch the RecordCacheArray again.  (Otherwise, it risks
>> reassigning a previously used local typmod.)

> How'd it reuse it after running the detach hook in workers?

Resetting NextRecordTypmod to zero means that we could reuse a typmod
that was previously used.  Maybe that's safe because no memory of the
old record definition exists anywhere else in the process, but I'm
not exactly convinced of that.  For that matter, I'm not exactly
convinced that nothing else is holding on to an actual pointer to the
record tupdesc, making it moot whether or not we flush typcache.c's
pointer.  (I'm pretty sure that plpgsql, for one, might hold onto
tupdesc pointers it gets from the typcache.  That's why they have
refcounts in the first place.)  There's never previously been any
expectation that record typmod registrations weren't good for the life
of the process, so I don't trust any of the assumptions this code
wants to make.

It's moot as long as we're not reusing workers, anyway: nothing is
going to touch any of the record-tupdesc data before process exit.
        regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [COMMITTERS] pgsql: Apply pg_get_serial_sequence() to identity column sequences asw
Next
From: Andres Freund
Date:
Subject: Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke