Skip site navigation (1) Skip section navigation (2)

pgsql: Fix a rare race condition when commit_siblings > 0 and a

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix a rare race condition when commit_siblings > 0 and a
Date: 2009-03-31 05:18:47
Message-ID: 20090331051847.905DB754ADE@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix a rare race condition when commit_siblings > 0 and a transaction commits
at the same instant as a new backend is spawned. Since CountActiveBackends()
doesn't hold ProcArrayLock, it needs to be prepared for the case that a
pointer at the end of the proc array is still NULL even though numProcs says
it should be valid, since it doesn't hold ProcArrayLock. Backpatch to 8.1.
8.0 and earlier had this right, but it was broken in the split of PGPROC and
sinval shared memory arrays.

Per report and proposal by Marko Kreen.

Tags:
----
REL8_1_STABLE

Modified Files:
--------------
    pgsql/src/backend/storage/ipc:
        procarray.c (r1.7.2.1 -> r1.7.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/ipc/procarray.c?r1=1.7.2.1&r2=1.7.2.2)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-03-31 17:59:56
Subject: pgsql: Add a "relistemp" boolean column to pg_class, which is true for
Previous:From: Heikki LinnakangasDate: 2009-03-31 05:18:43
Subject: pgsql: Fix a rare race condition when commit_siblings > 0 and a

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group