Commit 5766228b authored by Alvaro Herrera's avatar Alvaro Herrera

Fix Xmax freeze conditions

I broke this in 0ac5ad51; previously, freezing a tuple marked with an
IS_MULTI xmax was not necessary.

Per brokenness report from Jeff Janes.
parent 335c5e92
......@@ -5113,10 +5113,11 @@ heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
* cutoff; it doesn't remove dead members of a very old multixact.
*/
xid = HeapTupleHeaderGetRawXmax(tuple);
if (TransactionIdIsNormal(xid) &&
(((!(tuple->t_infomask & HEAP_XMAX_IS_MULTI) &&
TransactionIdPrecedes(xid, cutoff_xid))) ||
MultiXactIdPrecedes(xid, cutoff_multi)))
if ((tuple->t_infomask & HEAP_XMAX_IS_MULTI) ?
(MultiXactIdIsValid(xid) &&
MultiXactIdPrecedes(xid, cutoff_multi)) :
(TransactionIdIsNormal(xid) &&
TransactionIdPrecedes(xid, cutoff_xid)))
{
HeapTupleHeaderSetXmax(tuple, InvalidTransactionId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment