@@ -839,13 +839,16 @@ check_tuple_visibility(HeapCheckContext *ctx)
839
839
return false;
840
840
841
841
case XID_COMMITTED :
842
+
842
843
/*
843
844
* The tuple is dead, because the xvac transaction moved
844
- * it off and committed. It's checkable, but also prunable.
845
+ * it off and committed. It's checkable, but also
846
+ * prunable.
845
847
*/
846
848
return true;
847
849
848
850
case XID_ABORTED :
851
+
849
852
/*
850
853
* The original xmin must have committed, because the xvac
851
854
* transaction tried to move it later. Since xvac is
@@ -905,6 +908,7 @@ check_tuple_visibility(HeapCheckContext *ctx)
905
908
return false;
906
909
907
910
case XID_COMMITTED :
911
+
908
912
/*
909
913
* The original xmin must have committed, because the xvac
910
914
* transaction moved it later. Whether it's still alive
@@ -913,9 +917,11 @@ check_tuple_visibility(HeapCheckContext *ctx)
913
917
break ;
914
918
915
919
case XID_ABORTED :
920
+
916
921
/*
917
922
* The tuple is dead, because the xvac transaction moved
918
- * it off and committed. It's checkable, but also prunable.
923
+ * it off and committed. It's checkable, but also
924
+ * prunable.
919
925
*/
920
926
return true;
921
927
}
@@ -924,12 +930,12 @@ check_tuple_visibility(HeapCheckContext *ctx)
924
930
{
925
931
/*
926
932
* Inserting transaction is not in progress, and not committed, so
927
- * it might have changed the TupleDesc in ways we don't know about.
928
- * Thus, don't try to check the tuple structure.
933
+ * it might have changed the TupleDesc in ways we don't know
934
+ * about. Thus, don't try to check the tuple structure.
929
935
*
930
936
* If xmin_status happens to be XID_IS_CURRENT_XID, then in theory
931
- * any such DDL changes ought to be visible to us, so perhaps
932
- * we could check anyway in that case. But, for now, let's be
937
+ * any such DDL changes ought to be visible to us, so perhaps we
938
+ * could check anyway in that case. But, for now, let's be
933
939
* conservative and treat this like any other uncommitted insert.
934
940
*/
935
941
return false;
@@ -945,18 +951,19 @@ check_tuple_visibility(HeapCheckContext *ctx)
945
951
{
946
952
/*
947
953
* xmax is a multixact, so sanity-check the MXID. Note that we do this
948
- * prior to checking for HEAP_XMAX_INVALID or HEAP_XMAX_IS_LOCKED_ONLY.
949
- * This might therefore complain about things that wouldn't actually
950
- * be a problem during a normal scan, but eventually we're going to
951
- * have to freeze, and that process will ignore hint bits.
954
+ * prior to checking for HEAP_XMAX_INVALID or
955
+ * HEAP_XMAX_IS_LOCKED_ONLY. This might therefore complain about
956
+ * things that wouldn't actually be a problem during a normal scan,
957
+ * but eventually we're going to have to freeze, and that process will
958
+ * ignore hint bits.
952
959
*
953
960
* Even if the MXID is out of range, we still know that the original
954
961
* insert committed, so we can check the tuple itself. However, we
955
962
* can't rule out the possibility that this tuple is dead, so don't
956
963
* clear ctx->tuple_could_be_pruned. Possibly we should go ahead and
957
964
* clear that flag anyway if HEAP_XMAX_INVALID is set or if
958
- * HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side
959
- * of avoiding possibly-bogus complaints about missing TOAST entries.
965
+ * HEAP_XMAX_IS_LOCKED_ONLY is true, but for now we err on the side of
966
+ * avoiding possibly-bogus complaints about missing TOAST entries.
960
967
*/
961
968
xmax = HeapTupleHeaderGetRawXmax (tuphdr );
962
969
switch (check_mxid_valid_in_rel (xmax , ctx ))
@@ -1066,9 +1073,10 @@ check_tuple_visibility(HeapCheckContext *ctx)
1066
1073
* away depends on how old the deleting transaction is.
1067
1074
*/
1068
1075
ctx -> tuple_could_be_pruned = TransactionIdPrecedes (xmax ,
1069
- ctx -> safe_xmin );
1076
+ ctx -> safe_xmin );
1070
1077
break ;
1071
1078
case XID_ABORTED :
1079
+
1072
1080
/*
1073
1081
* The delete aborted or crashed. The tuple is still live.
1074
1082
*/
@@ -1127,15 +1135,17 @@ check_tuple_visibility(HeapCheckContext *ctx)
1127
1135
break ;
1128
1136
1129
1137
case XID_COMMITTED :
1138
+
1130
1139
/*
1131
1140
* The delete committed. Whether the toast can be vacuumed away
1132
1141
* depends on how old the deleting transaction is.
1133
1142
*/
1134
1143
ctx -> tuple_could_be_pruned = TransactionIdPrecedes (xmax ,
1135
- ctx -> safe_xmin );
1144
+ ctx -> safe_xmin );
1136
1145
break ;
1137
1146
1138
1147
case XID_ABORTED :
1148
+
1139
1149
/*
1140
1150
* The delete aborted or crashed. The tuple is still live.
1141
1151
*/
@@ -1248,6 +1258,7 @@ check_toast_tuple(HeapTuple toasttup, HeapCheckContext *ctx,
1248
1258
ta -> toast_pointer .va_valueid ,
1249
1259
chunk_seq , chunksize , expected_size ));
1250
1260
}
1261
+
1251
1262
/*
1252
1263
* Check the current attribute as tracked in ctx, recording any corruption
1253
1264
* found in ctx->tupstore.
0 commit comments