Re: condition variable cleanup and subtransactions - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: condition variable cleanup and subtransactions
Date
Msg-id CAEepm=14vAPMUEhm5drRU=v+7C89wS2c9dvFyNQoN-b5gGXObA@mail.gmail.com
Whole thread Raw
In response to condition variable cleanup and subtransactions  (Andres Freund <andres@anarazel.de>)
Responses Re: condition variable cleanup and subtransactions
Re: condition variable cleanup and subtransactions
List pgsql-hackers
On Fri, Dec 22, 2017 at 12:00 AM, Andres Freund <andres@anarazel.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.

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


pgsql-hackers by date:

Previous
From: Ildar Musin
Date:
Subject: Re: General purpose hashing func in pgbench
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] parallel.c oblivion of worker-startup failures