Re: [HACKERS] Notice: heap_open/close changes committed - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] Notice: heap_open/close changes committed
Date
Msg-id 37E58CCF.32C57B87@krs.ru
Whole thread Raw
In response to Notice: heap_open/close changes committed  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Notice: heap_open/close changes committed
List pgsql-hackers
Tom Lane wrote:
> 
> 2. I made most opens of system relations grab AccessShareLock if
> read-only, or RowExclusiveLock if read-write, on the theory that               ^^^^^^^^^^^^^^^^
> these accesses correspond to an ordinary search or update of a user
> relation.  This maximizes concurrency of access to the system tables.

There are problems here. In the case of normal UPDATE/DELETE
(when RowExclusiveLock is acquired) Executor takes care about
the-same-row writers, but other parts of system don't check
is tuple read being updated concurrent transaction or not.
This is the old bug (pre-6.5.X released WRITE lock just after
system table was modified). I had no time to fix it and so
just changed old WRITE lock with new AccessExclusiveLock.
But we have to handle this in proper way (wait if t_xmax
is id of an active transaction).

Vadim


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Command Locations (was Re: HISTORY for 6.5....)
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] Why do we need pg_vlock?