mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Cosmetic fixes for KnownAssignedXidsGetOldestXmin, per Fujii Masao.
This commit is contained in:
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.74 2010/08/30 14:16:48 sriggs Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.75 2010/08/30 17:30:44 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -156,7 +156,7 @@ static int KnownAssignedXidsGet(TransactionId *xarray, TransactionId xmax);
|
|||||||
static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray,
|
static int KnownAssignedXidsGetAndSetXmin(TransactionId *xarray,
|
||||||
TransactionId *xmin,
|
TransactionId *xmin,
|
||||||
TransactionId xmax);
|
TransactionId xmax);
|
||||||
static int KnownAssignedXidsGetOldestXmin(void);
|
static TransactionId KnownAssignedXidsGetOldestXmin(void);
|
||||||
static void KnownAssignedXidsDisplay(int trace_level);
|
static void KnownAssignedXidsDisplay(int trace_level);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -564,7 +564,7 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Now we have a copy of any KnownAssignedXids we can zero the array
|
* Now we have a copy of any KnownAssignedXids we can zero the array
|
||||||
* before we re-insertion of combined snapshot.
|
* before we re-insert combined snapshot.
|
||||||
*/
|
*/
|
||||||
KnownAssignedXidsRemovePreceding(InvalidTransactionId);
|
KnownAssignedXidsRemovePreceding(InvalidTransactionId);
|
||||||
|
|
||||||
@ -1120,6 +1120,7 @@ GetOldestXmin(bool allDbs, bool ignoreVacuum)
|
|||||||
* older than the main procarray.
|
* older than the main procarray.
|
||||||
*/
|
*/
|
||||||
TransactionId kaxmin = KnownAssignedXidsGetOldestXmin();
|
TransactionId kaxmin = KnownAssignedXidsGetOldestXmin();
|
||||||
|
|
||||||
if (TransactionIdIsNormal(kaxmin) &&
|
if (TransactionIdIsNormal(kaxmin) &&
|
||||||
TransactionIdPrecedes(kaxmin, result))
|
TransactionIdPrecedes(kaxmin, result))
|
||||||
result = kaxmin;
|
result = kaxmin;
|
||||||
@ -3028,7 +3029,11 @@ KnownAssignedXidsGetAndSetXmin(TransactionId *xarray, TransactionId *xmin,
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
/*
|
||||||
|
* Get oldest XID in the KnownAssignedXids array, or InvalidTransactionId
|
||||||
|
* if nothing there.
|
||||||
|
*/
|
||||||
|
static TransactionId
|
||||||
KnownAssignedXidsGetOldestXmin(void)
|
KnownAssignedXidsGetOldestXmin(void)
|
||||||
{
|
{
|
||||||
/* use volatile pointer to prevent code rearrangement */
|
/* use volatile pointer to prevent code rearrangement */
|
||||||
|
Reference in New Issue
Block a user