Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6737aa7

Browse files
committed
Fix HeapTupleSatisfiesVacuum on aborted updater xacts
By using only the macro that checks infomask bitsHEAP_XMAX_IS_LOCKED_ONLY to verify whether a multixact is not anupdater, and not the full HeapTupleHeaderIsOnlyLocked, it would come tothe wrong result in case of a multixact containing an aborted update;therefore returning the wrong result code. This would cause predicate.cto break completely (as in bug report #8273 from David Leverton), andcertain index builds would misbehave. As far as I can tell, othercallers of the bogus routine would make harmless mistakes or not beaffected by the difference at all; so this was a pretty narrow case.Also, no other user of the HEAP_XMAX_IS_LOCKED_ONLY macro is ascareless; they all check specifically for the HEAP_XMAX_IS_MULTI case,and they all verify whether the updater is InvalidXid before concludingthat it's a valid updater. So there doesn't seem to be any similar bug.
1 parentc8fb821 commit6737aa7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/utils/time/tqual.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,9 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
12871287
{
12881288
if (tuple->t_infomask&HEAP_XMAX_INVALID)/* xid invalid */
12891289
returnHEAPTUPLE_INSERT_IN_PROGRESS;
1290-
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask))
1290+
/* only locked? run infomask-only check first, for performance */
1291+
if (HEAP_XMAX_IS_LOCKED_ONLY(tuple->t_infomask)||
1292+
HeapTupleHeaderIsOnlyLocked(tuple))
12911293
returnHEAPTUPLE_INSERT_IN_PROGRESS;
12921294
/* inserted and then deleted by same xact */
12931295
returnHEAPTUPLE_DELETE_IN_PROGRESS;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp