Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions - Mailing list pgsql-bugs

From Tomasz Zielonka
Subject Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Date
Msg-id 20010824181957.A26882@mult.i.pl
Whole thread Raw
List pgsql-bugs
Hi!

I'm using PostgreSQL 7.1.3 on Intel PIII, Linux 2.4.8, Slackware 8.0,
compiled with egcs 2.91.66 (the same on 7.1.2 / 2.95.3).

I'm encountering very strange deadlock situation. Strange, because after
this deadlock occurs, even with no active postgres processes (postmaster only),
when I connect with psql I can't select anything from affected table.

Here is a (almost) minimal test:

CREATE TABLE items (
    id      INTEGER NOT NULL,
    amount  FLOAT   NOT NULL,
    PRIMARY KEY (id)
);

-- amount field is probably no longer necessary, but I haven't tested without
-- it

And run this in TWO concurrent sessions:

$ yes 'begin; select * from items; lock table items; commit;' | psql

I get deadlock here quite fast.
Both processes freeze on next select.
Stop them (ctrl-c).

ps xa shows only postmaster process, no postgres ones.

Now connect which psql and try to 'SELECT * FROM items'.
Freeze again.


What do you think?


Have a nice weekend :)
Greetings,
Tom

--
.signature: Too many levels of symbolic links

pgsql-bugs by date:

Previous
From: Tomasz Zielonka
Date:
Subject: Re: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #428: Another security issue with the JDBC driver.