Skip to content

Commit ee3838b

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 parent 12bf602 commit ee3838b

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(const bool visible, const Relation relation,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy