HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts
Date: 2011-10-17 18:33:36
Message-ID: 1318876416.4e9c75001bfc7@webmail.no-ip.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I just noticed that HeapTupleHeaderAdvanceLatestRemovedXid is comparing Xmax as a TransactionId without verifying whether it is a multixact or not. Since they advance separately, this could lead to bogus answers. This probably needs to be fixed. I didn't look into past releases to see if there's a live released bug here or not.

I think the fix is simply to ignore the Xmax if the HEAP_XMAX_IS_MULTI bit is set.

Additionally I think it should check HEAP_XMAX_INVALID before reading the Xmax at all.

--
Álvaro Herrera (from some crappy webmail)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-10-17 19:03:50 Re: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts
Previous Message Shigeru Hanada 2011-10-17 17:27:15 Re: WIP: Collecting statistics on CSV file data