Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions

From: Tomasz Zielonka <tomek(at)mult(dot)i(dot)pl>
To: PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Date: 2001-08-24 16:19:57
Message-ID: 20010824181957.A26882@mult.i.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-08-24 17:20:00 Bug #428: Another security issue with the JDBC driver.
Previous Message Bruce Momjian 2001-08-24 16:02:30 Re: Bug #424: JDBC driver security issue.