Group clear xid can leak semaphore count

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Group clear xid can leak semaphore count
Date: 2016-12-31 05:44:32
Message-ID: CAA4eK1JyVqXiMba+-a589Rk0pyHsyKkGxeumVKjU6Y74hdrVLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

[1] - https://www.postgresql.org/message-id/CAA4eK1J%2B67edo_Wnrfx8oJ%2BrWM_BAr%2Bv6JqvQjKPdLOxR%3D0d5g%40mail.gmail.com
--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
fix_absorbed_wakeups_clear_xid_v1.patch application/octet-stream 727 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-12-31 05:46:33 generating fmgr prototypes automatically
Previous Message Peter Eisentraut 2016-12-31 05:30:41 Re: Add doc advice about systemd RemoveIPC