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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Attachment Content-Type Size
unknown_filename text/plain 9.1 KB

Responses

Browse pgsql-patches by date

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