Skip to content

Commit bbbc211

Browse files
committed
Fix xid table sizing.
1 parent dfefad7 commit bbbc211

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/backend/storage/lmgr/lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.54 1999/05/25 22:42:03 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.55 1999/05/29 06:14:42 vadim Exp $
1111
*
1212
* NOTES
1313
* Outside modules can create a lock table and acquire/release
@@ -1532,7 +1532,7 @@ LockShmemSize(int maxBackends)
15321532
SHMEM_LOCKTAB_DATASIZE);
15331533

15341534
/* xidHash table */
1535-
size += hash_estimate_size(maxBackends,
1535+
size += hash_estimate_size(NLOCKENTS(maxBackends),
15361536
SHMEM_XIDTAB_KEYSIZE,
15371537
SHMEM_XIDTAB_DATASIZE);
15381538

src/include/storage/lock.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: lock.h,v 1.28 1999/05/25 22:43:26 momjian Exp $
9+
* $Id: lock.h,v 1.29 1999/05/29 06:14:42 vadim Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -31,10 +31,11 @@ typedef int MASK;
3131
* See LockShmemSize() in lock.c.
3232
*
3333
* NLOCKS_PER_XACT - The number of unique locks acquired in a transaction
34+
* (should be configurable!)
3435
* NLOCKENTS - The maximum number of lock entries in the lock table.
3536
* ----------------------
3637
*/
37-
#define NLOCKS_PER_XACT 40
38+
#define NLOCKS_PER_XACT 64
3839
#define NLOCKENTS(maxBackends) (NLOCKS_PER_XACT*(maxBackends))
3940

4041
typedef int LOCKMODE;

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