Re: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts
Date: 2011-10-17 19:03:50
Message-ID: 17713.1318878230@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> 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.

If it's failing to even check XMAX_INVALID, surely it's completely
broken? Perhaps it assumes its caller has checked all this?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2011-10-17 19:07:37 Re: HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts
Previous Message Alvaro Herrera 2011-10-17 18:33:36 HeapTupleHeaderAdvanceLatestRemovedXid doing the wrong thing with multixacts