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

heap_tuple_needs_freeze false positive

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: heap_tuple_needs_freeze false positive
Date: 2012-02-02 01:01:27
Message-ID: 1328144350-sup-771@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

I noticed that heap_tuple_needs_freeze might return true in cases where
the Xmax is leftover junk from somebody who set HEAP_XMAX_INVALID in the
far past without resetting the Xmax value itself to Invalid.  I think
this is incorrect usage; the rule, I think, is that one shouldn't even
read Xmax at all unless HEAP_XMAX_INVALID is reset.

This might cause unnecessary acquisitions of the cleanup lock, if a
tuple is deemed freezable when in fact it isn't.

Suggested patch attached.  I'd backpatch this as far as it applies
cleanly.

-- 
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>

Attachment: heap_tuple_needs_freeze.patch
Description: application/octet-stream (887 bytes)

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2012-02-02 01:07:55
Subject: Re: feature request - datum_compute_size and datum write_should be public
Previous:From: Alvaro HerreraDate: 2012-02-02 00:58:42
Subject: Re: foreign key locks, 2nd attempt

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