Re: Group clear xid can leak semaphore count

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Group clear xid can leak semaphore count
Date: 2017-01-06 06:33:15
Message-ID: CAA4eK1+vEGAaoHwQ9cbqMO4e__s9P63zVAaX8jmd8qHR4jC+ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 6, 2017 at 1:13 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sat, Dec 31, 2016 at 12:44 AM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>> During the review of Group update Clog patch [1], Dilip noticed an
>> issue with the patch where it can leak the semaphore count in one of
>> the corner case. I have checked and found that similar issue exists
>> for Group clear xid (ProcArrayGroupClearXid) as well. I think the
>> reason why this problem is not noticed by anyone till now is that it
>> can happen only in a rare scenario when the backend waiting for xid
>> clear is woken up due to some unrelated signal. This problem didn't
>> exist in the original commit
>> (0e141c0fbb211bdd23783afa731e3eef95c9ad7a) of the patch, but later
>> while fixing some issues in the committed patch, it got introduced in
>> commit 4aec49899e5782247e134f94ce1c6ee926f88e1c. Patch to fix the
>> issue is attached.
>
> Yeah, that looks like a bug. Thanks for the detailed analysis;
> committed and back-patched to 9.6.
>

Thanks for committing the fix. I have updated the CF app entry for this patch.

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-01-06 07:56:47 Re: Declarative partitioning - another take
Previous Message Pavel Stehule 2017-01-06 06:28:22 Re: merging some features from plpgsql2 project