diff options
Diffstat (limited to 'src/backend/utils/time/tqual.c')
-rw-r--r-- | src/backend/utils/time/tqual.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c index 1ebc5ff8795..e5d0b0a666e 100644 --- a/src/backend/utils/time/tqual.c +++ b/src/backend/utils/time/tqual.c @@ -596,13 +596,26 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid, if (TransactionIdDidCommit(xmax)) return HeapTupleUpdated; - /* no member, even just a locker, alive anymore */ + /* + * By here, the update in the Xmax is either aborted or crashed, but + * what about the other members? + */ + if (!MultiXactIdIsRunning(HeapTupleHeaderGetRawXmax(tuple))) + { + /* + * 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); - - /* it must have aborted or crashed */ - return HeapTupleMayBeUpdated; + return HeapTupleMayBeUpdated; + } + else + { + /* There are lockers running */ + return HeapTupleBeingUpdated; + } } if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetRawXmax(tuple))) |