Skip to content

Commit 5766228

Browse files
committed
Fix Xmax freeze conditions
I broke this in 0ac5ad5; previously, freezing a tuple marked with an IS_MULTI xmax was not necessary. Per brokenness report from Jeff Janes.
1 parent 335c5e9 commit 5766228

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/backend/access/heap/heapam.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5113,10 +5113,11 @@ heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
51135113
* cutoff; it doesn't remove dead members of a very old multixact.
51145114
*/
51155115
xid = HeapTupleHeaderGetRawXmax(tuple);
5116-
if (TransactionIdIsNormal(xid) &&
5117-
(((!(tuple->t_infomask & HEAP_XMAX_IS_MULTI) &&
5118-
TransactionIdPrecedes(xid, cutoff_xid))) ||
5119-
MultiXactIdPrecedes(xid, cutoff_multi)))
5116+
if ((tuple->t_infomask & HEAP_XMAX_IS_MULTI) ?
5117+
(MultiXactIdIsValid(xid) &&
5118+
MultiXactIdPrecedes(xid, cutoff_multi)) :
5119+
(TransactionIdIsNormal(xid) &&
5120+
TransactionIdPrecedes(xid, cutoff_xid)))
51205121
{
51215122
HeapTupleHeaderSetXmax(tuple, InvalidTransactionId);
51225123

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy