possible deadlock: different lock ordering for heap pages
Nishant, Fnu <nishantf@amazon.com>
From: "Nishant, Fnu" <nishantf@amazon.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-01-18T22:31:55Z
Lists: pgsql-hackers
Attachments
- lock-order.patch (application/octet-stream) patch
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
Commits
-
Avoid possible deadlock while locking multiple heap pages.
- 0b8bdb3c3ec0 12.0 landed
- fba0a8292997 9.4.21 landed
- 6a2c9c633135 9.5.16 landed
- 073afae81989 9.6.12 landed
- 1ca33fc7b511 10.7 landed
- 904413637f8b 11.2 landed
-
Try again to make the visibility map crash safe.
- e16954f3d27f 9.2.0 cited