aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-02-09 12:15:08 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2011-02-09 12:23:07 +0200
commit036bb15872fa52f6f403ca22d36a8652bbaf9d3c (patch)
tree74fb856c54b0bac9b34298d6fb19f9670fd6f30a /src
parent3144c33a2f764610d7ad56f1b82e9716d0d65447 (diff)
downloadpostgresql-036bb15872fa52f6f403ca22d36a8652bbaf9d3c.tar.gz
postgresql-036bb15872fa52f6f403ca22d36a8652bbaf9d3c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/lmgr/predicate.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index b66fd8678cc..722d0f86be4 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -1119,7 +1119,7 @@ InitPredicateLocks(void)
SHMQueueInit(&RWConflictPool->availableList);
requestSize = mul_size((Size) max_table_size,
- PredXactListElementDataSize);
+ RWConflictDataSize);
RWConflictPool->element = ShmemAlloc(requestSize);
if (RWConflictPool->element == NULL)
ereport(ERROR,
@@ -1190,11 +1190,17 @@ PredicateLockShmemSize(void)
size = add_size(size, hash_estimate_size(max_table_size,
sizeof(SERIALIZABLEXID)));
+ /* rw-conflict pool */
+ max_table_size *= 5;
+ size = add_size(size, RWConflictPoolHeaderDataSize);
+ size = add_size(size, mul_size((Size) max_table_size,
+ RWConflictDataSize));
+
/* Head for list of finished serializable transactions. */
size = add_size(size, sizeof(SHM_QUEUE));
/* Shared memory structures for SLRU tracking of old committed xids. */
- size = add_size(size, sizeof(OldSerXidControl));
+ size = add_size(size, sizeof(OldSerXidControlData));
size = add_size(size, SimpleLruShmemSize(NUM_OLDSERXID_BUFFERS, 0));
return size;