Skip to content

Commit bfaa8c6

Browse files
committed
Fix calculation of PREDICATELOCK_MANAGER_LWLOCK_OFFSET.
Commit ea9df81 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.
1 parent 9ba78fb commit bfaa8c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/include/storage/lwlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ extern PGDLLIMPORT LWLockPadded *MainLWLockArray;
151151
#define LOCK_MANAGER_LWLOCK_OFFSET \
152152
(BUFFER_MAPPING_LWLOCK_OFFSET + NUM_BUFFER_PARTITIONS)
153153
#define PREDICATELOCK_MANAGER_LWLOCK_OFFSET \
154-
(NUM_INDIVIDUAL_LWLOCKS + NUM_LOCK_PARTITIONS)
154+
(LOCK_MANAGER_LWLOCK_OFFSET + NUM_LOCK_PARTITIONS)
155155
#define NUM_FIXED_LWLOCKS \
156156
(PREDICATELOCK_MANAGER_LWLOCK_OFFSET + NUM_PREDICATELOCK_PARTITIONS)
157157

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy