From: | Alfred Perlstein <bright(at)wintelcom(dot)net> |
---|---|
To: | Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> |
Cc: | pgsql-hackers(at)hub(dot)org |
Subject: | Re: Orphaned locks in 7.0? |
Date: | 2000-05-15 16:23:58 |
Message-ID: | 20000515092357.R28383@fw.wintelcom.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
* Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> [000515 02:07] wrote:
> > -----Original Message-----
> > From: pgsql-hackers-owner(at)hub(dot)org [mailto:pgsql-hackers-owner(at)hub(dot)org]On
> > Behalf Of Alfred Perlstein
> >
> > Basically I was running two instances of psql, in one I issued:
> >
> > one two
> >
> > begin;
> > lock data; -- some table
> > lock data;^C -- cancel
> > select * from data;^C -- cancel
> > end;
> >
> > lock data;^C -- HUNG then aborted
> >
> > It's annoying that I can't seem to reproduce this, and I know LOCKs
> > are only to be requested during a transaction, but it did happen.
> >
>
> Could the following example explain your HUNG problem ?
>
> Session-1
> # begin;
> BEGIN
> =# lock t;
> LOCK TABLE
>
> Session-2
> =# begin;
> BEGIN
> =# lock t;
> [blocked] ^C
> Cancel request sent
> ERROR: Query cancel requested while waiting lock
> reindex=# select * from t;
> [blocked]
>
> Session-1
> =# commit;
> COMMIT
>
> Session-2
> ERROR: LockRelation: LockAcquire failed
> =# abort;
> ROLLBACK
> =# lock t;
> [blocked]
That looks pretty much like the sequence of events that lead up to
the problem, the problem is that I was just manually testing out
the way locks work and didn't write down the exact steps I took.
This is probably exactly the right steps though.
--
-Alfred Perlstein - [bright(at)wintelcom(dot)net|alfred(at)freebsd(dot)org]
"I have the heart of a child; I keep it in a jar on my desk."
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Mount | 2000-05-15 16:25:42 | JDBC 7.0 binaries |
Previous Message | Tom Lane | 2000-05-15 16:16:21 | Re: AW: type conversion discussion |