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

Commitee3838b

Browse files
committed
You must hold a lock on the heap page when you call
CheckForSerializableConflictOut(), because it can set hint bits.YAMAMOTO Takashi
1 parent12bf602 commitee3838b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,10 +1472,10 @@ heap_fetch(Relation relation,
14721472
if (valid)
14731473
PredicateLockTuple(relation,tuple);
14741474

1475-
LockBuffer(buffer,BUFFER_LOCK_UNLOCK);
1476-
14771475
CheckForSerializableConflictOut(valid,relation,tuple,buffer);
14781476

1477+
LockBuffer(buffer,BUFFER_LOCK_UNLOCK);
1478+
14791479
if (valid)
14801480
{
14811481
/*

‎src/backend/storage/lmgr/predicate.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,9 +3366,10 @@ XidIsConcurrent(TransactionId xid)
33663366
* If the transactions overlap (i.e., they cannot see each other's writes),
33673367
* then we have a conflict out.
33683368
*
3369-
* This function should be called just about anywhere in heapam.c that a
3370-
* tuple has been read. There is currently no known reason to call this
3371-
* function from an index AM.
3369+
* This function should be called just about anywhere in heapam.c where a
3370+
* tuple has been read. The caller must hold at least a shared lock on the
3371+
* buffer, because this function might set hint bits on the tuple. There is
3372+
* currently no known reason to call this function from an index AM.
33723373
*/
33733374
void
33743375
CheckForSerializableConflictOut(constboolvisible,constRelationrelation,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp