Re: [HACKERS] 'Waiting on lock' - Mailing list pgsql-patches

From Tom Lane
Subject Re: [HACKERS] 'Waiting on lock'
Date
Msg-id 19797.1182357385@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] 'Waiting on lock'  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: [HACKERS] 'Waiting on lock'  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-patches
Gregory Stark <stark@enterprisedb.com> writes:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>> How you figure that?

> Well I'm not clear exactly what's going on with the semaphores here. If it's
> possible for to be printing the messages only as a result of another backend
> unlocking the semaphore then making the PGSemaphoreUnlock conditional on
> log_lock_waits means you can't enable log_lock_waits after startup and get
> deterministic behaviour because whether you get messages will depend on which
> other backend happens to wake you up.

I don't see how you arrive at that conclusion.  The message is printed
by the backend that is waiting for (or just obtained) a lock, dependent
on its own local setting of log_lock_waits, and not dependent on who
woke it up.

BTW, I just noticed that GUC allows deadlock_timeout to be set all the
way down to zero.  This seems bad --- surely the minimum value should at
least be positive?  As CVS HEAD stands, you're likely to get a lot of
spurious/useless log messages if you have log_lock_waits = true and
deadlock_timeout = 0.  Do we care?

            regards, tom lane

pgsql-patches by date:

Previous
From: Gregory Stark
Date:
Subject: Re: [HACKERS] 'Waiting on lock'
Next
From: Ireneusz Pluta
Date:
Subject: postgresql-icu patch status