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

Commitc928dc9

Browse files
committed
Fix old visibility bug in HeapTupleSatisfiesDirty
If a tuple is locked but not updated by a concurrent transaction,HeapTupleSatisfiesDirty would return that transaction's Xid in xmax,causing callers to wait on it, when it is not necessary (in fact, if theother transaction had used a multixact instead of a plain Xid to markthe tuple, HeapTupleSatisfiesDirty would have behave differently and*not* returned the Xmax).This bug was introduced in commit3f7fbf8, dated December 1998,so it's almost 15 years old now. However, it's hard to see thismisbehave, because before we had NOWAIT the only consequence of this isthat transactions would wait for slightly more time than necessary; soit's not surprising that this hasn't been reported yet.Craig Ringer and Andres Freund
1 parent7112775 commitc928dc9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,8 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
861861

862862
if (TransactionIdIsInProgress(HeapTupleHeaderGetXmax(tuple)))
863863
{
864-
snapshot->xmax=HeapTupleHeaderGetXmax(tuple);
864+
if (!(tuple->t_infomask&HEAP_IS_LOCKED))
865+
snapshot->xmax=HeapTupleHeaderGetXmax(tuple);
865866
return true;
866867
}
867868

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp