Commit 174a5133 authored by Tom Lane's avatar Tom Lane

Cosmetic fixes for KnownAssignedXidsGetOldestXmin, per Fujii Masao.

parent eb36d1ad
...@@ -37,7 +37,7 @@ ...@@ -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); ...@@ -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) ...@@ -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) ...@@ -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, ...@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment