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

Commitf7feb02

Browse files
committed
Fix GetNewTransactionId()'s interaction with xidVacLimit.
Commitad30805 switched to returning a FullTransactionId, butfailed to load the potentially updated value in the case wherexidVacLimit is reached and we release and reacquire the lock.Repair, closing bug #15727.While reviewing that commit, also fix the size computation usedby EstimateTransactionStateSize() and switch to the mul_size()macro traditionally used in such expressions.Author: Thomas MunroReported-by: Roman ZharkovDiscussion:https://postgr.es/m/15727-0be246e7d852d229%40postgresql.org
1 parentd87ab88 commitf7feb02

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎src/backend/access/transam/varsup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ GetNewTransactionId(bool isSubXact)
159159

160160
/* Re-acquire lock and start over */
161161
LWLockAcquire(XidGenLock,LW_EXCLUSIVE);
162-
xid=XidFromFullTransactionId(ShmemVariableCache->nextFullXid);
162+
full_xid=ShmemVariableCache->nextFullXid;
163+
xid=XidFromFullTransactionId(full_xid);
163164
}
164165

165166
/*

‎src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5151,7 +5151,7 @@ EstimateTransactionStateSpace(void)
51515151
nxids=add_size(nxids,s->nChildXids);
51525152
}
51535153

5154-
returnadd_size(size,sizeof(SerializedTransactionState)*nxids);
5154+
returnadd_size(size,mul_size(sizeof(TransactionId),nxids));
51555155
}
51565156

51575157
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp