mirror of
https://github.com/postgres/postgres.git
synced 2025-05-03 22:24:49 +03:00
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.
This commit is contained in:
parent
3144c33a2f
commit
036bb15872
@ -1119,7 +1119,7 @@ InitPredicateLocks(void)
|
|||||||
|
|
||||||
SHMQueueInit(&RWConflictPool->availableList);
|
SHMQueueInit(&RWConflictPool->availableList);
|
||||||
requestSize = mul_size((Size) max_table_size,
|
requestSize = mul_size((Size) max_table_size,
|
||||||
PredXactListElementDataSize);
|
RWConflictDataSize);
|
||||||
RWConflictPool->element = ShmemAlloc(requestSize);
|
RWConflictPool->element = ShmemAlloc(requestSize);
|
||||||
if (RWConflictPool->element == NULL)
|
if (RWConflictPool->element == NULL)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
@ -1190,11 +1190,17 @@ PredicateLockShmemSize(void)
|
|||||||
size = add_size(size, hash_estimate_size(max_table_size,
|
size = add_size(size, hash_estimate_size(max_table_size,
|
||||||
sizeof(SERIALIZABLEXID)));
|
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. */
|
/* Head for list of finished serializable transactions. */
|
||||||
size = add_size(size, sizeof(SHM_QUEUE));
|
size = add_size(size, sizeof(SHM_QUEUE));
|
||||||
|
|
||||||
/* Shared memory structures for SLRU tracking of old committed xids. */
|
/* 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));
|
size = add_size(size, SimpleLruShmemSize(NUM_OLDSERXID_BUFFERS, 0));
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user