pgsql: Repair a low-probability race condition identified by Qingqing - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Repair a low-probability race condition identified by Qingqing
Date
Msg-id 20060414033856.61F4311F6C45@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Repair a low-probability race condition identified by Qingqing Zhou.
If a process abandons a wait in LockBufferForCleanup (in practice,
only happens if someone cancels a VACUUM) just before someone else
sends it a signal indicating the buffer is available, it was possible
for the wakeup to remain in the process' semaphore, causing misbehavior
next time the process waited for an lmgr lock.  Rather than try to
prevent the race condition directly, it seems best to make the lock
manager robust against leftover wakeups, by having it repeat waiting
on the semaphore if the lock has not actually been granted or denied
yet.

Modified Files:
--------------
    pgsql/src/backend/storage/buffer:
        bufmgr.c (r1.206 -> r1.207)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/buffer/bufmgr.c.diff?r1=1.206&r2=1.207)
    pgsql/src/backend/storage/lmgr:
        lock.c (r1.163 -> r1.164)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/lock.c.diff?r1=1.163&r2=1.164)
        proc.c (r1.173 -> r1.174)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/lmgr/proc.c.diff?r1=1.173&r2=1.174)
    pgsql/src/include:
        c.h (r1.199 -> r1.200)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/c.h.diff?r1=1.199&r2=1.200)
    pgsql/src/include/storage:
        proc.h (r1.87 -> r1.88)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/proc.h.diff?r1=1.87&r2=1.88)

pgsql-committers by date:

Previous
From: nwakefield@pgfoundry.org (User Nwakefield)
Date:
Subject: bizgres - bizgres: Default value for field did not work when default
Next
From: h-saito@pgfoundry.org (User H-saito)
Date:
Subject: psqlodbc - psqlodbc: Construction by VS2005Express+PSDK-x86 is