Skip to content

Commit 036bb15

Browse files
committed
Fix allocation of RW-conflict pool in the new predicate lock manager, and
also take the RW-conflict pool into account in the PredicateLockShmemSize() estimate.
1 parent 3144c33 commit 036bb15

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/backend/storage/lmgr/predicate.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ InitPredicateLocks(void)
11191119

11201120
SHMQueueInit(&RWConflictPool->availableList);
11211121
requestSize = mul_size((Size) max_table_size,
1122-
PredXactListElementDataSize);
1122+
RWConflictDataSize);
11231123
RWConflictPool->element = ShmemAlloc(requestSize);
11241124
if (RWConflictPool->element == NULL)
11251125
ereport(ERROR,
@@ -1190,11 +1190,17 @@ PredicateLockShmemSize(void)
11901190
size = add_size(size, hash_estimate_size(max_table_size,
11911191
sizeof(SERIALIZABLEXID)));
11921192

1193+
/* rw-conflict pool */
1194+
max_table_size *= 5;
1195+
size = add_size(size, RWConflictPoolHeaderDataSize);
1196+
size = add_size(size, mul_size((Size) max_table_size,
1197+
RWConflictDataSize));
1198+
11931199
/* Head for list of finished serializable transactions. */
11941200
size = add_size(size, sizeof(SHM_QUEUE));
11951201

11961202
/* Shared memory structures for SLRU tracking of old committed xids. */
1197-
size = add_size(size, sizeof(OldSerXidControl));
1203+
size = add_size(size, sizeof(OldSerXidControlData));
11981204
size = add_size(size, SimpleLruShmemSize(NUM_OLDSERXID_BUFFERS, 0));
11991205

12001206
return size;

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