Skip to content

Commit 93f84d5

Browse files
committed
Revert "Remove pointless HeapTupleHeaderIndicatesMovedPartitions calls"
This reverts commit 85adb5e. It was not intended for commit just yet.
1 parent 85adb5e commit 93f84d5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/backend/access/heap/heapam.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,8 @@ heap_delete(Relation relation, ItemPointer tid,
26182618
HEAP_XMAX_IS_LOCKED_ONLY(tp.t_data->t_infomask) ||
26192619
HeapTupleHeaderIsOnlyLocked(tp.t_data))
26202620
result = TM_Ok;
2621-
else if (!ItemPointerEquals(&tp.t_self, &tp.t_data->t_ctid))
2621+
else if (!ItemPointerEquals(&tp.t_self, &tp.t_data->t_ctid) ||
2622+
HeapTupleHeaderIndicatesMovedPartitions(tp.t_data))
26222623
result = TM_Updated;
26232624
else
26242625
result = TM_Deleted;
@@ -3247,7 +3248,8 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
32473248

32483249
if (can_continue)
32493250
result = TM_Ok;
3250-
else if (!ItemPointerEquals(&oldtup.t_self, &oldtup.t_data->t_ctid))
3251+
else if (!ItemPointerEquals(&oldtup.t_self, &oldtup.t_data->t_ctid) ||
3252+
HeapTupleHeaderIndicatesMovedPartitions(oldtup.t_data))
32513253
result = TM_Updated;
32523254
else
32533255
result = TM_Deleted;
@@ -4483,7 +4485,8 @@ heap_lock_tuple(Relation relation, HeapTuple tuple,
44834485
HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_data->t_infomask) ||
44844486
HeapTupleHeaderIsOnlyLocked(tuple->t_data))
44854487
result = TM_Ok;
4486-
else if (!ItemPointerEquals(&tuple->t_self, &tuple->t_data->t_ctid))
4488+
else if (!ItemPointerEquals(&tuple->t_self, &tuple->t_data->t_ctid) ||
4489+
HeapTupleHeaderIndicatesMovedPartitions(tuple->t_data))
44874490
result = TM_Updated;
44884491
else
44894492
result = TM_Deleted;
@@ -5056,7 +5059,8 @@ test_lockmode_for_conflict(MultiXactStatus status, TransactionId xid,
50565059
LOCKMODE_from_mxstatus(wantedstatus)))
50575060
{
50585061
/* bummer */
5059-
if (!ItemPointerEquals(&tup->t_self, &tup->t_data->t_ctid))
5062+
if (!ItemPointerEquals(&tup->t_self, &tup->t_data->t_ctid) ||
5063+
HeapTupleHeaderIndicatesMovedPartitions(tup->t_data))
50605064
return TM_Updated;
50615065
else
50625066
return TM_Deleted;

src/backend/access/heap/heapam_visibility.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,8 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
607607
{
608608
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask))
609609
return TM_Ok;
610-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
610+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
611+
HeapTupleHeaderIndicatesMovedPartitions(tuple))
611612
return TM_Updated; /* updated by other */
612613
else
613614
return TM_Deleted; /* deleted by other */
@@ -652,7 +653,8 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
652653

653654
if (TransactionIdDidCommit(xmax))
654655
{
655-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
656+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
657+
HeapTupleHeaderIndicatesMovedPartitions(tuple))
656658
return TM_Updated;
657659
else
658660
return TM_Deleted;
@@ -712,7 +714,8 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
712714

713715
SetHintBits(tuple, buffer, HEAP_XMAX_COMMITTED,
714716
HeapTupleHeaderGetRawXmax(tuple));
715-
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid))
717+
if (!ItemPointerEquals(&htup->t_self, &tuple->t_ctid) ||
718+
HeapTupleHeaderIndicatesMovedPartitions(tuple))
716719
return TM_Updated; /* updated by other */
717720
else
718721
return TM_Deleted; /* deleted by other */

0 commit comments

Comments
 (0)