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

Commit47a338c

Browse files
committed
Fix SxactGlobalXmin tracking.
Commitbb16aba broke the code that maintains SxactGlobalXmin. Itcould get stuck when a well-timed READ ONLY transaction runs. IfSxactGlobalXmin stops advancing, transactions on theFinishedSerializableTransactions queue are never cleaned up, soresources are effectively leaked. Revert that hunk of the commit.Also revert another similar hunk that was probably harmless, butunnecessary and unjustified, relating to the DOOMED flag in case ofRO_SAFE early release.Author: Thomas MunroReported-by: Tom LaneDiscussion:https://postgr.es/m/16170.1557251214%40sss.pgh.pa.us
1 parentcd805f4 commit47a338c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3438,8 +3438,7 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
34383438
* cleanup. This means it should not be considered when calculating
34393439
* SxactGlobalXmin.
34403440
*/
3441-
if (!isReadOnlySafe)
3442-
MySerializableXact->flags |=SXACT_FLAG_DOOMED;
3441+
MySerializableXact->flags |=SXACT_FLAG_DOOMED;
34433442
MySerializableXact->flags |=SXACT_FLAG_ROLLED_BACK;
34443443

34453444
/*
@@ -3635,8 +3634,7 @@ ReleasePredicateLocks(bool isCommit, bool isReadOnlySafe)
36353634
* was launched.
36363635
*/
36373636
needToClear= false;
3638-
if (!isReadOnlySafe&&
3639-
TransactionIdEquals(MySerializableXact->xmin,PredXact->SxactGlobalXmin))
3637+
if (TransactionIdEquals(MySerializableXact->xmin,PredXact->SxactGlobalXmin))
36403638
{
36413639
Assert(PredXact->SxactGlobalXminCount>0);
36423640
if (--(PredXact->SxactGlobalXminCount)==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp