From bbbc211ed13c5b42a4d0589c3df24f170cfeeda9 Mon Sep 17 00:00:00 2001 From: "Vadim B. Mikheev" <vadim4o@yahoo.com> Date: Sat, 29 May 1999 06:14:43 +0000 Subject: [PATCH] Fix xid table sizing. --- src/backend/storage/lmgr/lock.c | 4 ++-- src/include/storage/lock.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 15d55ab647f..2349e956a89 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.54 1999/05/25 22:42:03 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.55 1999/05/29 06:14:42 vadim Exp $ * * NOTES * Outside modules can create a lock table and acquire/release @@ -1532,7 +1532,7 @@ LockShmemSize(int maxBackends) SHMEM_LOCKTAB_DATASIZE); /* xidHash table */ - size += hash_estimate_size(maxBackends, + size += hash_estimate_size(NLOCKENTS(maxBackends), SHMEM_XIDTAB_KEYSIZE, SHMEM_XIDTAB_DATASIZE); diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index 20fbdff9090..8693231a8c6 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: lock.h,v 1.28 1999/05/25 22:43:26 momjian Exp $ + * $Id: lock.h,v 1.29 1999/05/29 06:14:42 vadim Exp $ * *------------------------------------------------------------------------- */ @@ -31,10 +31,11 @@ typedef int MASK; * See LockShmemSize() in lock.c. * * NLOCKS_PER_XACT - The number of unique locks acquired in a transaction + * (should be configurable!) * NLOCKENTS - The maximum number of lock entries in the lock table. * ---------------------- */ -#define NLOCKS_PER_XACT 40 +#define NLOCKS_PER_XACT 64 #define NLOCKENTS(maxBackends) (NLOCKS_PER_XACT*(maxBackends)) typedef int LOCKMODE; -- GitLab