Re: Rome university - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Rome university
Date
Msg-id 20060502214837.GB18026@surnet.cl
Whole thread Raw
In response to Rome university  (letizia leo <letizia_leo@yahoo.it>)
List pgsql-hackers
letizia leo wrote:

> and the doubt is the following: how is it possible that -line 144- Xmin 
> is the current transaction ( i.e. it has created this tuple, it is 
> holding an exclusive lock on it since it has not committed yet) and 
> that 
> -line 149- there is a different (?) transaction that is also locking 
> the 
> tuple (HEAP_IS_LOCKED=(HEAP_XMAX_EXCL_LOCK||HEAP_XMAX_SHARED_LOCK) )? 
> Unless we are missing something, this situation is possible exclusively 
> in case the XMAX transaction is a subtransaction of XMIN, which can 
> access the tuple despite the exclusive lock held by XMIN.

Exactly.

> This seems correct according to the comment in line 154, which refers
> to a "subtransaction".

It is correct.

> Are we understanding correctly what this code is doing and the related 
> underlying MVCC mechanisms?

Can't say, but that part at least you got right :-)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: letizia leo
Date:
Subject: Rome university
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Rome university