]> granicus.if.org Git - postgresql/commitdiff
Fix the number of lwlocks needed by the "fast path" lock patch. It needs
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 27 Oct 2011 19:39:58 +0000 (22:39 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 27 Oct 2011 19:39:58 +0000 (22:39 +0300)
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).

src/backend/storage/lmgr/lwlock.c

index 8fae67ebbb5d50ce4355f54df02e0d1dacb554aa..079eb29163e75e271a746bb8808da99fa4575ac3 100644 (file)
@@ -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;