From b573f5d4bf2fab905fe3c830056f3e8a713e5dfc Mon Sep 17 00:00:00 2001 From: Zhao Song Date: Thu, 8 Oct 2026 17:49:07 +0200 Subject: [PATCH v1] Remove redundant MultiXactIdIsRunning() check in HeapTupleSatisfiesUpdate() When a tuple's xmax is a multixact containing an update, HeapTupleSatisfiesUpdate() checks whether any member is still running and returns TM_BeingModified if so. If the updater is subsequently found to have aborted, there is no need to check the multixact again, since its membership is immutable and all members have already been confirmed to be no longer running. The second check was introduced by commit 1ce150b7bb1, and its TM_BeingModified branch by commit 07aeb1fec57, when the initial check only considered the updater, leaving the possibility of active lockers. Commit 05315498012 extended the initial check to cover all members, making the second check redundant and its TM_BeingModified branch unreachable. Remove the redundant check. This does not change behavior, but avoids an unnecessary multixact member lookup and proc array scan when the updater has aborted. --- src/backend/access/heap/heapam_visibility.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/backend/access/heap/heapam_visibility.c b/src/backend/access/heap/heapam_visibility.c index 361b76e5065..741edba1a3f 100644 --- a/src/backend/access/heap/heapam_visibility.c +++ b/src/backend/access/heap/heapam_visibility.c @@ -680,21 +680,9 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid, * what about the other members? */ - if (!MultiXactIdIsRunning(HeapTupleHeaderGetRawXmax(tuple), false)) - { - /* - * There's no member, even just a locker, alive anymore, so we can - * mark the Xmax as invalid. - */ - SetHintBits(tuple, buffer, HEAP_XMAX_INVALID, - InvalidTransactionId); - return TM_Ok; - } - else - { - /* There are lockers running */ - return TM_BeingModified; - } + SetHintBits(tuple, buffer, HEAP_XMAX_INVALID, + InvalidTransactionId); + return TM_Ok; } if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetRawXmax(tuple))) -- 2.39.5 (Apple Git-154)