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

Commit46c333a

Browse files
committed
Fix overly strict assertion in SummarizeOldestCommittedSxact(). There's a
race condition where SummarizeOldestCommittedSxact() is called even thoughanother backend already cleared out all finished sxact entries. That's OK,RegisterSerializableTransactionInt() can just retry getting a news xactslot from the available-list when that happens.Reported by YAMAMOTO Takashi, bug #5918.
1 parent93d8882 commit46c333a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,15 +1314,21 @@ SummarizeOldestCommittedSxact(void)
13141314

13151315
LWLockAcquire(SerializableFinishedListLock,LW_EXCLUSIVE);
13161316

1317-
#ifdefTEST_OLDSERXID
1317+
/*
1318+
* This function is only called if there are no sxact slots available.
1319+
* Some of them must belong to old, already-finished transactions, so
1320+
* there should be something in FinishedSerializableTransactions list
1321+
* that we can summarize. However, there's a race condition: while we
1322+
* were not holding any locks, a transaction might have ended and cleaned
1323+
* up all the finished sxact entries already, freeing up their sxact
1324+
* slots. In that case, we have nothing to do here. The caller will find
1325+
* one of the slots released by the other backend when it retries.
1326+
*/
13181327
if (SHMQueueEmpty(FinishedSerializableTransactions))
13191328
{
13201329
LWLockRelease(SerializableFinishedListLock);
13211330
return;
13221331
}
1323-
#else
1324-
Assert(!SHMQueueEmpty(FinishedSerializableTransactions));
1325-
#endif
13261332

13271333
/*
13281334
* Grab the first sxact off the finished list -- this will be the earliest

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp