Re: Obscure: correctness of lock manager???

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Schoebel-Theuer <schoebel(at)informatik(dot)uni-stuttgart(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Obscure: correctness of lock manager???
Date: 2003-08-29 13:20:48
Message-ID: 12316.1062163248@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thomas Schoebel-Theuer <schoebel(at)informatik(dot)uni-stuttgart(dot)de> writes:
> the problem persists, even when starting from scratch. I did the following:

> + printf("lock\n"); fflush(stdout);
> +

> $ grep lock run/dbt3_logfile | wc -l

I'd bet that your logfile is not accumulating postmaster stdout, but
only stderr. Or maybe not even stderr --- where are you getting it
from exactly? Perhaps you're logging client-side output, rather than
that of the backends.

> Tom, it sounds really strange, and I also cannot nearly believe it,
> but I could imagine why that problem (if it really exists) was
> not detected before.

If I actually believed your experiment, it would prove that LockAcquire
wasn't being called at all. It is trivial to demonstrate that this is
not so, eg, attach to a backend with gdb and set a breakpoint at
LockAcquire. Or, if you'd like some more macroscopic proof that the
lock manager is doing something, try this:

psql session 1:

create table a(f1 int);
create table b(f1 int);
begin;
lock table a;

psql session 2:

begin;
lock table b;
lock table a;
-- note that it blocks waiting for session 1's lock

back in session 1:

lock table b;
-- note deadlock failure report

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2003-08-29 13:23:45 Re: ALTER TABLE
Previous Message Rod Taylor 2003-08-29 12:56:19 Re: ALTER TABLE