Consider other lockers of a xmax when it's a multi with an aborted update

This commit is contained in:
chenxiaobin 2021-12-20 07:56:10 +00:00 committed by Gitee
parent 27bdb0d62b
commit 841be96b35
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 14 additions and 4 deletions

View File

@ -793,11 +793,21 @@ restart:
}
}
/* no member, even just a locker, alive anymore */
if (!MultiXactIdIsRunning(HeapTupleHeaderGetXmax(page, tuple)))
/*
* By here, the update in the Xmax is either aborted or crashed, but
* what about the other members?
*/
if (!MultiXactIdIsRunning(HeapTupleHeaderGetXmax(page, 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 TM_Ok;
return TM_Ok;
} else {
/* There are lockers running */
return TM_BeingModified;
}
}
if (TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(page, tuple))) {