@@ -222,8 +222,9 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
222222TransactionId xmax ;
223223
224224xmax = HeapTupleGetUpdateXid (tuple );
225- if (!TransactionIdIsValid (xmax ))
226- return true;
225+
226+ /* not LOCKED_ONLY, so it has to have an xmax */
227+ Assert (TransactionIdIsValid (xmax ));
227228
228229/* updating subtransaction must have aborted */
229230if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -276,14 +277,17 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
276277return true;
277278
278279xmax = HeapTupleGetUpdateXid (tuple );
279- if (!TransactionIdIsValid (xmax ))
280- return true;
280+
281+ /* not LOCKED_ONLY, so it has to have an xmax */
282+ Assert (TransactionIdIsValid (xmax ));
283+
281284if (TransactionIdIsCurrentTransactionId (xmax ))
282285return false;
283286if (TransactionIdIsInProgress (xmax ))
284287return true;
285288if (TransactionIdDidCommit (xmax ))
286289return false;
290+ /* it must have aborted or crashed */
287291return true;
288292}
289293
@@ -690,8 +694,9 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
690694TransactionId xmax ;
691695
692696xmax = HeapTupleGetUpdateXid (tuple );
693- if (!TransactionIdIsValid (xmax ))
694- return HeapTupleMayBeUpdated ;
697+
698+ /* not LOCKED_ONLY, so it has to have an xmax */
699+ Assert (TransactionIdIsValid (xmax ));
695700
696701/* updating subtransaction must have aborted */
697702if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -766,14 +771,9 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
766771}
767772
768773xmax = HeapTupleGetUpdateXid (tuple );
769- if (!TransactionIdIsValid (xmax ))
770- {
771- if (MultiXactIdIsRunning (HeapTupleHeaderGetRawXmax (tuple )))
772- return HeapTupleBeingUpdated ;
773774
774- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
775- return HeapTupleMayBeUpdated ;
776- }
775+ /* not LOCKED_ONLY, so it has to have an xmax */
776+ Assert (TransactionIdIsValid (xmax ));
777777
778778if (TransactionIdIsCurrentTransactionId (xmax ))
779779{
@@ -783,13 +783,18 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
783783return HeapTupleInvisible ;/* updated before scan started */
784784}
785785
786- if (MultiXactIdIsRunning ( HeapTupleHeaderGetRawXmax ( tuple ) ))
786+ if (TransactionIdIsInProgress ( xmax ))
787787return HeapTupleBeingUpdated ;
788788
789789if (TransactionIdDidCommit (xmax ))
790790return HeapTupleUpdated ;
791+
792+ /* no member, even just a locker, alive anymore */
793+ if (!MultiXactIdIsRunning (HeapTupleHeaderGetRawXmax (tuple )))
794+ SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,
795+ InvalidTransactionId );
796+
791797/* it must have aborted or crashed */
792- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
793798return HeapTupleMayBeUpdated ;
794799}
795800
@@ -911,8 +916,9 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
911916TransactionId xmax ;
912917
913918xmax = HeapTupleGetUpdateXid (tuple );
914- if (!TransactionIdIsValid (xmax ))
915- return true;
919+
920+ /* not LOCKED_ONLY, so it has to have an xmax */
921+ Assert (TransactionIdIsValid (xmax ));
916922
917923/* updating subtransaction must have aborted */
918924if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -969,8 +975,10 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
969975return true;
970976
971977xmax = HeapTupleGetUpdateXid (tuple );
972- if (!TransactionIdIsValid (xmax ))
973- return true;
978+
979+ /* not LOCKED_ONLY, so it has to have an xmax */
980+ Assert (TransactionIdIsValid (xmax ));
981+
974982if (TransactionIdIsCurrentTransactionId (xmax ))
975983return false;
976984if (TransactionIdIsInProgress (xmax ))
@@ -980,6 +988,7 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
980988}
981989if (TransactionIdDidCommit (xmax ))
982990return false;
991+ /* it must have aborted or crashed */
983992return true;
984993}
985994
@@ -1104,8 +1113,9 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
11041113TransactionId xmax ;
11051114
11061115xmax = HeapTupleGetUpdateXid (tuple );
1107- if (!TransactionIdIsValid (xmax ))
1108- return true;
1116+
1117+ /* not LOCKED_ONLY, so it has to have an xmax */
1118+ Assert (TransactionIdIsValid (xmax ));
11091119
11101120/* updating subtransaction must have aborted */
11111121if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -1164,8 +1174,10 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
11641174Assert (!HEAP_XMAX_IS_LOCKED_ONLY (tuple -> t_infomask ));
11651175
11661176xmax = HeapTupleGetUpdateXid (tuple );
1167- if (!TransactionIdIsValid (xmax ))
1168- return true;
1177+
1178+ /* not LOCKED_ONLY, so it has to have an xmax */
1179+ Assert (TransactionIdIsValid (xmax ));
1180+
11691181if (TransactionIdIsCurrentTransactionId (xmax ))
11701182{
11711183if (HeapTupleHeaderGetCmax (tuple ) >=snapshot -> curcid )
@@ -1182,6 +1194,7 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
11821194return true;/* treat as still in progress */
11831195return false;
11841196}
1197+ /* it must have aborted or crashed */
11851198return true;
11861199}
11871200
@@ -1376,8 +1389,10 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
13761389Assert (!HEAP_XMAX_IS_LOCKED_ONLY (tuple -> t_infomask ));
13771390
13781391xmax = HeapTupleGetUpdateXid (tuple );
1379- if (!TransactionIdIsValid (xmax ))
1380- return HEAPTUPLE_LIVE ;
1392+
1393+ /* not LOCKED_ONLY, so it has to have an xmax */
1394+ Assert (TransactionIdIsValid (xmax ));
1395+
13811396if (TransactionIdIsInProgress (xmax ))
13821397return HEAPTUPLE_DELETE_IN_PROGRESS ;
13831398else if (TransactionIdDidCommit (xmax ))
@@ -1390,8 +1405,10 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
13901405Assert (!(tuple -> t_infomask & HEAP_XMAX_COMMITTED ));
13911406
13921407xmax = HeapTupleGetUpdateXid (tuple );
1393- if (!TransactionIdIsValid (xmax ))
1394- return HEAPTUPLE_LIVE ;
1408+
1409+ /* not LOCKED_ONLY, so it has to have an xmax */
1410+ Assert (TransactionIdIsValid (xmax ));
1411+
13951412/* multi is not running -- updating xact cannot be */
13961413Assert (!TransactionIdIsInProgress (xmax ));
13971414if (TransactionIdDidCommit (xmax ))
@@ -1401,22 +1418,13 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
14011418else
14021419return HEAPTUPLE_DEAD ;
14031420}
1404- else
1405- {
1406- /*
1407- * Not in Progress, Not Committed, so either Aborted or crashed.
1408- */
1409- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
1410- return HEAPTUPLE_LIVE ;
1411- }
14121421
14131422/*
1414- *Deleter committed, but perhaps it was recent enough that some open
1415- *transactions could still see thetuple .
1423+ *Not in Progress, Not Committed, so either Aborted or crashed.
1424+ *Remove theXmax .
14161425 */
1417-
1418- /* Otherwise, it's dead and removable */
1419- return HEAPTUPLE_DEAD ;
1426+ SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
1427+ return HEAPTUPLE_LIVE ;
14201428}
14211429
14221430if (!(tuple -> t_infomask & HEAP_XMAX_COMMITTED ))
@@ -1655,8 +1663,9 @@ HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple)
16551663
16561664/* ... but if it's a multi, then perhaps the updating Xid aborted. */
16571665xmax = HeapTupleGetUpdateXid (tuple );
1658- if (!TransactionIdIsValid (xmax ))/* shouldn't happen .. */
1659- return true;
1666+
1667+ /* not LOCKED_ONLY, so it has to have an xmax */
1668+ Assert (TransactionIdIsValid (xmax ));
16601669
16611670if (TransactionIdIsCurrentTransactionId (xmax ))
16621671return false;