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

Re: Minor fix in lwlock.c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Minor fix in lwlock.c
Date: 2005-04-08 05:20:42
Message-ID: 9304.1112937642@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> writes:
> I guess the problem is here:

>  /*
>   * Fix the process wait semaphore's count for any absorbed wakeups.
>   */
>  while (extraWaits-- > 0)
>   PGSemaphoreUnlock(&proc->sem);

Mmm.  Could be a problem, but the chances of having extraWaits>0 is
really pretty small.  In any case, FATAL doesn't fix this, because
it will still try to go through normal backend exit cleanup which
requires having working LWLock support.  If you take the above risk
seriously then you need a PANIC error.

The alternative would be to move the Unlock loop in front of the
addition of the LWLock to held_lwlocks[], but I think that cure
is probably worse than the disease --- the chance of an error during
Unlock seems nonzero.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Qingqing ZhouDate: 2005-04-08 05:29:15
Subject: Re: Minor fix in lwlock.c
Previous:From: Qingqing ZhouDate: 2005-04-08 05:04:25
Subject: Re: Minor fix in lwlock.c

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