| From: | "Nishant, Fnu" <nishantf(at)amazon(dot)com> |
|---|---|
| To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | possible deadlock: different lock ordering for heap pages |
| Date: | 2019-01-18 22:31:55 |
| Message-ID: | 5883C831-2ED1-47C8-BFAC-2D5BAE5A8CAE@amazon.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hello,
While locking heap pages (function RelationGetBufferForTuple() in file hio.c) we acquire locks in increasing block number order to avoid deadlock. In certain cases, we do have to drop and reacquire lock on heap pages (when we have to pin visibility map pages) to avoid doing IO while holding exclusive lock. The problem is we now acquire locks in bufferId order, which looks like a slip and the intention was to grab it in block number order. Since it is a trivial change, I am attaching a patch to correct it.
Thanks,
Nishant
| Attachment | Content-Type | Size |
|---|---|---|
| lock-order.patch | application/octet-stream | 553 bytes |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tomas Vondra | 2019-01-18 22:32:48 | Re: jsonpath |
| Previous Message | Andres Freund | 2019-01-18 22:19:41 | Re: What to name the current heap after pluggable storage / what to rename? |