mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.
Commit ea9df812d8
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.
This commit is contained in:
parent
9ba78fb0b9
commit
bfaa8c665f
@ -151,7 +151,7 @@ extern PGDLLIMPORT LWLockPadded *MainLWLockArray;
|
||||
#define LOCK_MANAGER_LWLOCK_OFFSET \
|
||||
(BUFFER_MAPPING_LWLOCK_OFFSET + NUM_BUFFER_PARTITIONS)
|
||||
#define PREDICATELOCK_MANAGER_LWLOCK_OFFSET \
|
||||
(NUM_INDIVIDUAL_LWLOCKS + NUM_LOCK_PARTITIONS)
|
||||
(LOCK_MANAGER_LWLOCK_OFFSET + NUM_LOCK_PARTITIONS)
|
||||
#define NUM_FIXED_LWLOCKS \
|
||||
(PREDICATELOCK_MANAGER_LWLOCK_OFFSET + NUM_PREDICATELOCK_PARTITIONS)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user