Re: pgsql: Add support for coordinating record typmods among parallel worke

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add support for coordinating record typmods among parallel worke
Date: 2017-09-15 06:47:10
Message-ID: CAEepm=0y78KA-UFVA=q8joA4m9tPre5y7VxMy2Jzigo+O6E6MA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Sep 15, 2017 at 4:59 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Looks like force_parallel_mode might be the key to causing that.

Yeah. The regress tests in d36f7efb39e1b9613193b2e12717dbe2418ddae5
tested this stuff in parallel mode, but only a happy case to
demonstrate blessed RECORD types travelling through tqueue.c correctly
before and after ripping out the remapping stuff. The problem here
was that I do some cleanup in the DSM detach hook of the new session
segment, and that involved reading data that could point to another
segment (if the DSA area needed more space). That can blow up if that
other segment happens to have been unmapped first in the arbitrary
order of resource cleanup in an aborting worker. I do have some
thoughts on how to solve that general problem, but in this case it's
completely unnecessary anyway. The attached patch fixes the problem
by getting rid of the code that accesses shmem in the detach hook.
With this patch applied installcheck survives on a cluster with
force_parallel_worker=regress.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Fix-crash-in-shared_record_typmod_registry_worker_de.patch application/octet-stream 2.4 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-09-15 12:19:42 pgsql: Test coverage for CREATE/ALTER FOREIGN DATA WRAPPER .. HANDLER.
Previous Message Tom Lane 2017-09-15 04:59:35 Re: pgsql: Add support for coordinating record typmods among parallel worke

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-09-15 07:22:23 Re: Setting pd_lower in GIN metapage
Previous Message Amit Langote 2017-09-15 06:41:33 Re: Race between SELECT and ALTER TABLE NO INHERIT