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

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Repair a low-probability race condition identified by Qingqing
Date: 2006-04-14 03:38:56
Message-ID: 20060414033856.61F4311F6C45@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message User Shachar 2006-04-14 20:12:27 oledb - oledb: Revert misplaced initialization of ulColumnSize
Previous Message User H-saito 2006-04-14 03:30:02 psqlodbc - psqlodbc: Construction by VS2005Express+PSDK-x86 is