RE: Issue NOTICE for attempt to raise lock level? - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject RE: Issue NOTICE for attempt to raise lock level?
Date
Msg-id EKEJJICOHDIEMGPNIFIJMENMCMAA.Inoue@tpf.co.jp
Whole thread Raw
In response to Issue NOTICE for attempt to raise lock level?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Issue NOTICE for attempt to raise lock level?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> -----Original Message-----
> From: Tom Lane
> Sent: Wednesday, November 08, 2000 1:26 AM
> To: pgsql-hackers@postgreSQL.org
> Subject: [HACKERS] Issue NOTICE for attempt to raise lock level?
> 
> 
> I am working on eliminating the "relation NNN modified while in use"
> misfeature by instead grabbing a lock on each relation at first use
> in a statement, and holding that lock till end of transaction. 

Isn't "relation NNN modified while in use" itself coming from heap_
open(r) 's LockRelation_after_allocate sequence ?
Or from a rd_refcnt leak,of cource.
I'm thinking that RelationCacheInvalidate() should ignore relations
which are while in use. IMHO allocate_after_lock sequence is
needed for heap_open(r). 

> The
> main trick here is to make sure that the first lock grabbed is adequate
> --- for example, it won't do to grab AccessShareLock and then have to
> raise that to AccessExclusiveLock, because there will be a deadlock if
> two backends do this concurrently.
> 

I object to you if it also includes parse_rewrite_plan stage.
If there's a long transation it would also hold a AccessShareLock
on system tables for a long time. Then vacuum for system tables
would be blocked. Other transactions would be blocked......

Regards.
Hiroshi Inoue 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: AW: v7.0.3 *pre-release* ...
Next
From: Tom Lane
Date:
Subject: Re: Issue NOTICE for attempt to raise lock level?