Re: condition variable cleanup and subtransactions

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: condition variable cleanup and subtransactions
Date: 2017-12-21 14:25:27
Message-ID: CA+TgmoaWzE1xVJa3vgyt4PUX=FO+fG0uqXj7F=NsLjdCSLLDtw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, Dec 21, 2017 at 6:46 AM, Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Fri, Dec 22, 2017 at 12:00 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
>> Oh. This seems to be a condition variable bug independent of PHJ. The
>> problem is that the DSM segment etc all get cleaned up in
>> *subtransaction* abort.
>>
>> Afaict it's a bug that AbortTransaction() does
>> ConditionVariableCancelSleep() but AbortSubTransaction() does not,
>> despite the latter releasing dsm segments via
>> ResourceOwnerRelease(RESOURCE_RELEASE_BEFORE_LOCKS).
>>
>> Adding that seems to fix the crash.
>>
>> This seems like something we need to backpatch.
>
> Agreed. That affects any user of condition variables inside DSM
> segments, including the released Parallel Index Scan and Parallel
> Bitmap Heap Scan code.

Fixed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-12-21 15:57:17 pgsql: Avoid putting build-location-dependent strings into generated fi
Previous Message Robert Haas 2017-12-21 14:25:03 pgsql: Cancel CV sleep during subtransaction abort.

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2017-12-21 14:26:01 Re: domain cast in parameterized vs. non-parameterized query
Previous Message Tom Lane 2017-12-21 14:22:36 Re: Reproducible builds: genbki.pl and Gen_fmgrtab.pl