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

Commit60b142b

Browse files
committed
Fix a tiny race condition in predicate locking. Need to hold the lock while
examining the head of predicate locks list. Also, fix the comment ofRemoveTargetIfNoLongerUsed, it was neglected when we changed the way updatechains are handled.Kevin Grittner
1 parentc8ae318 commit60b142b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,9 +1755,8 @@ CoarserLockCovers(const PREDICATELOCKTARGETTAG *newtargettag)
17551755
}
17561756

17571757
/*
1758-
* Check whether both the list of related predicate locks and the pointer to
1759-
* a prior version of the row (if this is a tuple lock target) are empty for
1760-
* a predicate lock target, and remove the target if they are.
1758+
* Check whether the list of related predicate locks is empty for a
1759+
* predicate lock target, and remove the target if it is.
17611760
*/
17621761
staticvoid
17631762
RemoveTargetIfNoLongerUsed(PREDICATELOCKTARGET*target,uint32targettaghash)
@@ -3120,11 +3119,11 @@ ClearOldPredicateLocks(void)
31203119
/*
31213120
* Loop through predicate locks on dummy transaction for summarized data.
31223121
*/
3122+
LWLockAcquire(SerializablePredicateLockListLock,LW_SHARED);
31233123
predlock= (PREDICATELOCK*)
31243124
SHMQueueNext(&OldCommittedSxact->predicateLocks,
31253125
&OldCommittedSxact->predicateLocks,
31263126
offsetof(PREDICATELOCK,xactLink));
3127-
LWLockAcquire(SerializablePredicateLockListLock,LW_SHARED);
31283127
while (predlock)
31293128
{
31303129
PREDICATELOCK*nextpredlock;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp