@@ -223,8 +223,9 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
223223TransactionId xmax ;
224224
225225xmax = HeapTupleGetUpdateXid (tuple );
226- if (!TransactionIdIsValid (xmax ))
227- return true;
226+
227+ /* not LOCKED_ONLY, so it has to have an xmax */
228+ Assert (TransactionIdIsValid (xmax ));
228229
229230/* updating subtransaction must have aborted */
230231if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -277,14 +278,17 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
277278return true;
278279
279280xmax = HeapTupleGetUpdateXid (tuple );
280- if (!TransactionIdIsValid (xmax ))
281- return true;
281+
282+ /* not LOCKED_ONLY, so it has to have an xmax */
283+ Assert (TransactionIdIsValid (xmax ));
284+
282285if (TransactionIdIsCurrentTransactionId (xmax ))
283286return false;
284287if (TransactionIdIsInProgress (xmax ))
285288return true;
286289if (TransactionIdDidCommit (xmax ))
287290return false;
291+ /* it must have aborted or crashed */
288292return true;
289293}
290294
@@ -497,8 +501,9 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
497501TransactionId xmax ;
498502
499503xmax = HeapTupleGetUpdateXid (tuple );
500- if (!TransactionIdIsValid (xmax ))
501- return HeapTupleMayBeUpdated ;
504+
505+ /* not LOCKED_ONLY, so it has to have an xmax */
506+ Assert (TransactionIdIsValid (xmax ));
502507
503508/* updating subtransaction must have aborted */
504509if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -573,14 +578,9 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
573578}
574579
575580xmax = HeapTupleGetUpdateXid (tuple );
576- if (!TransactionIdIsValid (xmax ))
577- {
578- if (MultiXactIdIsRunning (HeapTupleHeaderGetRawXmax (tuple )))
579- return HeapTupleBeingUpdated ;
580581
581- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
582- return HeapTupleMayBeUpdated ;
583- }
582+ /* not LOCKED_ONLY, so it has to have an xmax */
583+ Assert (TransactionIdIsValid (xmax ));
584584
585585if (TransactionIdIsCurrentTransactionId (xmax ))
586586{
@@ -590,13 +590,18 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
590590return HeapTupleInvisible ;/* updated before scan started */
591591}
592592
593- if (MultiXactIdIsRunning ( HeapTupleHeaderGetRawXmax ( tuple ) ))
593+ if (TransactionIdIsInProgress ( xmax ))
594594return HeapTupleBeingUpdated ;
595595
596596if (TransactionIdDidCommit (xmax ))
597597return HeapTupleUpdated ;
598+
599+ /* no member, even just a locker, alive anymore */
600+ if (!MultiXactIdIsRunning (HeapTupleHeaderGetRawXmax (tuple )))
601+ SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,
602+ InvalidTransactionId );
603+
598604/* it must have aborted or crashed */
599- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
600605return HeapTupleMayBeUpdated ;
601606}
602607
@@ -722,8 +727,9 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
722727TransactionId xmax ;
723728
724729xmax = HeapTupleGetUpdateXid (tuple );
725- if (!TransactionIdIsValid (xmax ))
726- return true;
730+
731+ /* not LOCKED_ONLY, so it has to have an xmax */
732+ Assert (TransactionIdIsValid (xmax ));
727733
728734/* updating subtransaction must have aborted */
729735if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -780,8 +786,10 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
780786return true;
781787
782788xmax = HeapTupleGetUpdateXid (tuple );
783- if (!TransactionIdIsValid (xmax ))
784- return true;
789+
790+ /* not LOCKED_ONLY, so it has to have an xmax */
791+ Assert (TransactionIdIsValid (xmax ));
792+
785793if (TransactionIdIsCurrentTransactionId (xmax ))
786794return false;
787795if (TransactionIdIsInProgress (xmax ))
@@ -791,6 +799,7 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
791799}
792800if (TransactionIdDidCommit (xmax ))
793801return false;
802+ /* it must have aborted or crashed */
794803return true;
795804}
796805
@@ -915,8 +924,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
915924TransactionId xmax ;
916925
917926xmax = HeapTupleGetUpdateXid (tuple );
918- if (!TransactionIdIsValid (xmax ))
919- return true;
927+
928+ /* not LOCKED_ONLY, so it has to have an xmax */
929+ Assert (TransactionIdIsValid (xmax ));
920930
921931/* updating subtransaction must have aborted */
922932if (!TransactionIdIsCurrentTransactionId (xmax ))
@@ -975,8 +985,10 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
975985Assert (!HEAP_XMAX_IS_LOCKED_ONLY (tuple -> t_infomask ));
976986
977987xmax = HeapTupleGetUpdateXid (tuple );
978- if (!TransactionIdIsValid (xmax ))
979- return true;
988+
989+ /* not LOCKED_ONLY, so it has to have an xmax */
990+ Assert (TransactionIdIsValid (xmax ));
991+
980992if (TransactionIdIsCurrentTransactionId (xmax ))
981993{
982994if (HeapTupleHeaderGetCmax (tuple ) >=snapshot -> curcid )
@@ -993,6 +1005,7 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
9931005return true;/* treat as still in progress */
9941006return false;
9951007}
1008+ /* it must have aborted or crashed */
9961009return true;
9971010}
9981011
@@ -1191,8 +1204,10 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
11911204Assert (!HEAP_XMAX_IS_LOCKED_ONLY (tuple -> t_infomask ));
11921205
11931206xmax = HeapTupleGetUpdateXid (tuple );
1194- if (!TransactionIdIsValid (xmax ))
1195- return HEAPTUPLE_LIVE ;
1207+
1208+ /* not LOCKED_ONLY, so it has to have an xmax */
1209+ Assert (TransactionIdIsValid (xmax ));
1210+
11961211if (TransactionIdIsInProgress (xmax ))
11971212return HEAPTUPLE_DELETE_IN_PROGRESS ;
11981213else if (TransactionIdDidCommit (xmax ))
@@ -1205,8 +1220,10 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
12051220Assert (!(tuple -> t_infomask & HEAP_XMAX_COMMITTED ));
12061221
12071222xmax = HeapTupleGetUpdateXid (tuple );
1208- if (!TransactionIdIsValid (xmax ))
1209- return HEAPTUPLE_LIVE ;
1223+
1224+ /* not LOCKED_ONLY, so it has to have an xmax */
1225+ Assert (TransactionIdIsValid (xmax ));
1226+
12101227/* multi is not running -- updating xact cannot be */
12111228Assert (!TransactionIdIsInProgress (xmax ));
12121229if (TransactionIdDidCommit (xmax ))
@@ -1216,22 +1233,13 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
12161233else
12171234return HEAPTUPLE_DEAD ;
12181235}
1219- else
1220- {
1221- /*
1222- * Not in Progress, Not Committed, so either Aborted or crashed.
1223- */
1224- SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
1225- return HEAPTUPLE_LIVE ;
1226- }
12271236
12281237/*
1229- *Deleter committed, but perhaps it was recent enough that some open
1230- *transactions could still see thetuple .
1238+ *Not in Progress, Not Committed, so either Aborted or crashed.
1239+ *Remove theXmax .
12311240 */
1232-
1233- /* Otherwise, it's dead and removable */
1234- return HEAPTUPLE_DEAD ;
1241+ SetHintBits (tuple ,buffer ,HEAP_XMAX_INVALID ,InvalidTransactionId );
1242+ return HEAPTUPLE_LIVE ;
12351243}
12361244
12371245if (!(tuple -> t_infomask & HEAP_XMAX_COMMITTED ))
@@ -1474,8 +1482,9 @@ HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple)
14741482
14751483/* ... but if it's a multi, then perhaps the updating Xid aborted. */
14761484xmax = HeapTupleGetUpdateXid (tuple );
1477- if (!TransactionIdIsValid (xmax ))/* shouldn't happen .. */
1478- return true;
1485+
1486+ /* not LOCKED_ONLY, so it has to have an xmax */
1487+ Assert (TransactionIdIsValid (xmax ));
14791488
14801489if (TransactionIdIsCurrentTransactionId (xmax ))
14811490return false;