diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-10-27 22:39:58 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2011-10-27 22:39:58 +0300 |
commit | cbf65509bb59694412286239fe6db409060f8d69 (patch) | |
tree | bae5d159368095f8b727ea69726c4311af40db21 /src | |
parent | 051d1ba7a02d0e8930adf228d60e8a044b9fcadb (diff) | |
download | postgresql-cbf65509bb59694412286239fe6db409060f8d69.tar.gz postgresql-cbf65509bb59694412286239fe6db409060f8d69.zip |
Fix the number of lwlocks needed by the "fast path" lock patch. It needs
one lock per backend or auxiliary process - the need for a lock for each
aux processes was not accounted for in NumLWLocks(). No-one noticed,
because the three locks needed for the three aux processes fit into the
few extra lwlocks we allocate for 3rd party modules that don't call
RequestAddinLWLocks() (NUM_USER_DEFINED_LWLOCKS, 4 by default).
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 8fae67ebbb5..079eb29163e 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -167,8 +167,8 @@ NumLWLocks(void) /* bufmgr.c needs two for each shared buffer */ numLocks += 2 * NBuffers; - /* lock.c needs one per backend */ - numLocks += MaxBackends; + /* proc.c needs one for each backend or auxiliary process */ + numLocks += MaxBackends + NUM_AUXILIARY_PROCS; /* clog.c needs one per CLOG buffer */ numLocks += NUM_CLOG_BUFFERS; |