Skip site navigation (1) Skip section navigation (2)

Proposed patch for xact-vs-multixact bugs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgreSQL(dot)org
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Subject: Proposed patch for xact-vs-multixact bugs
Date: 2006-11-17 01:23:35
Message-ID: 4833.1163726615@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
The attached patch fixes the problem discussed here
http://archives.postgresql.org/pgsql-hackers/2006-11/msg00357.php
as well as a related problem that I discovered while working on it:
the sequence

begin;
savepoint x;
select * from foo for update;
release savepoint x;
select * from foo for share;

leaves us holding only share lock not exclusive lock on the selected
tuples.  That's because heap_lock_tuple() considered only the
exact-XID-equality case when checking to see if we were requesting
share lock while already holding exclusive lock.  We should treat
exclusive lock held under any of the current backend's subtransactions
as not to be overridden.

In addition, this formulation avoids useless buffer-dirtying and WAL
reporting in all cases where the desired lock is already effectively held,
whereas the old code would go through the full pushups anyway.

I've only tested it against HEAD but it will need to be applied to 8.1
as well.

Anyone see any problems?

			regards, tom lane

Responses

pgsql-patches by date

Next:From: Jim NasbyDate: 2006-11-17 03:48:49
Subject: Re: Cast null to int4 upgrading from Version 7.2
Previous:From: Bruce MomjianDate: 2006-11-16 23:19:34
Subject: Re: [HACKERS] Extended protocol logging

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group