postgresql/src/backend
Amit Kapila fba0a82929 Avoid possible deadlock while locking multiple heap pages.
To avoid deadlock, backend acquires a lock on heap pages in block
number order.  In certain cases, lock on heap pages is dropped and
reacquired.  In this case, the locks are dropped for reading in
corresponding VM page/s. The issue is we re-acquire locks in bufferId
order whereas the intention was to acquire in blockid order.

This commit ensures that we will always acquire locks on heap pages in
blockid order.

Reported-by: Nishant Fnu
Author: Nishant Fnu
Reviewed-by: Amit Kapila and Robert Haas
Backpatch-through: 9.4
Discussion: https://postgr.es/m/5883C831-2ED1-47C8-BFAC-2D5BAE5A8CAE@amazon.com
2019-02-02 15:43:58 +05:30
..
access Avoid possible deadlock while locking multiple heap pages. 2019-02-02 15:43:58 +05:30
bootstrap Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:56:57 -07:00
catalog Have DISCARD ALL/TEMP remove leftover temp tables 2018-12-27 16:17:40 -03:00
commands Improve ANALYZE's handling of concurrent-update scenarios. 2019-01-03 17:00:08 -05:00
executor Allow btree comparison functions to return INT_MIN. 2018-10-05 16:01:30 -04:00
foreign Update copyright for 2014 2014-01-07 16:05:30 -05:00
lib Misc comment typo fixes. 2014-12-16 16:38:20 +02:00
libpq Fix set of NLS translation issues 2018-08-21 15:18:24 +09:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:04 -08:00
nodes Add stack depth checks to key recursive functions in backend/nodes/*.c. 2018-12-10 11:12:43 -05:00
optimizer Don't believe MinMaxExpr is leakproof without checking. 2019-01-02 16:33:48 -05:00
parser Postpone aggregate checks until after collation is assigned. 2019-01-17 06:35:31 +00:00
po Translation updates 2018-11-05 15:12:15 +01:00
port Support building with Visual Studio 2015 2018-09-11 15:44:42 -04:00
postmaster Make autovacuum more selective about temp tables to keep 2018-12-27 16:01:36 -03:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Fix handling of synchronous replication for stopping WAL senders 2018-11-29 09:13:04 +09:00
rewrite Fix set of NLS translation issues 2018-08-21 15:18:24 +09:00
snowball Fix ancient encoding error in hungarian.stop. 2014-06-10 22:48:31 -04:00
storage PANIC on fsync() failure. 2018-11-19 14:26:28 +13:00
tcop Allow UNLISTEN in hot-standby mode. 2019-01-25 21:14:31 -05:00
tsearch Make ts_locale.c's character-type functions cope with UTF-16. 2018-11-03 13:56:10 -04:00
utils Fix a crash in logical replication 2019-01-30 11:17:05 +01:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls.mk Translation updates 2015-02-01 23:18:42 -05:00