pgsql: Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.

From: Kevin Grittner <kgrittn(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.
Date: 2014-06-19 13:56:06
Message-ID: E1Wxcow-00080y-Bu@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.

Commit ea9df812d8502fff74e7bc37d61bdc7d66d77a7f failed to include
NUM_BUFFER_PARTITIONS in this offset, resulting in a bad offset.
Ultimately this threw off NUM_FIXED_LWLOCKS which is based on
earlier offsets, leading to memory allocation problems. It seems
likely to have also caused increased LWLOCK contention when
serializable transactions were used, because lightweight locks used
for that overlapped others.

Reported by Amit Kapila with analysis and fix.
Backpatch to 9.4, where the bug was introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bfaa8c665fcbd4388e01c53c4b5137f1f53d1787

Modified Files
--------------
src/include/storage/lwlock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-06-19 16:34:22 pgsql: Document SQL functions' behavior of parsing the whole function a
Previous Message Fujii Masao 2014-06-19 11:50:55 pgsql: Don't allow data_directory to be set in postgresql.auto.conf by