Commit 5b8bd052 authored by Simon Riggs's avatar Simon Riggs

Rename asyncCommitLSN to asyncXactLSN to reflect changed role in 9.0.

Transaction aborts now record their LSN to avoid corner case
behaviour in SR/HS, hence change of name of variables and functions.
As pointed out by Fujii Masao. Cosmetic changes only.
parent 478a2c12
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.294 2010/07/23 00:43:00 rhaas Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.295 2010/07/29 22:27:27 sriggs Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1086,7 +1086,7 @@ RecordTransactionCommit(void) ...@@ -1086,7 +1086,7 @@ RecordTransactionCommit(void)
* Report the latest async commit LSN, so that the WAL writer knows to * Report the latest async commit LSN, so that the WAL writer knows to
* flush this commit. * flush this commit.
*/ */
XLogSetAsyncCommitLSN(XactLastRecEnd); XLogSetAsyncXactLSN(XactLastRecEnd);
/* /*
* We must not immediately update the CLOG, since we didn't flush the * We must not immediately update the CLOG, since we didn't flush the
...@@ -1384,7 +1384,7 @@ RecordTransactionAbort(bool isSubXact) ...@@ -1384,7 +1384,7 @@ RecordTransactionAbort(bool isSubXact)
* problems occur at that point. * problems occur at that point.
*/ */
if (!isSubXact) if (!isSubXact)
XLogSetAsyncCommitLSN(XactLastRecEnd); XLogSetAsyncXactLSN(XactLastRecEnd);
/* /*
* Mark the transaction aborted in clog. This is not absolutely necessary * Mark the transaction aborted in clog. This is not absolutely necessary
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.430 2010/07/06 19:18:55 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.431 2010/07/29 22:27:27 sriggs Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -362,7 +362,7 @@ typedef struct XLogCtlData ...@@ -362,7 +362,7 @@ typedef struct XLogCtlData
XLogwrtResult LogwrtResult; XLogwrtResult LogwrtResult;
uint32 ckptXidEpoch; /* nextXID & epoch of latest checkpoint */ uint32 ckptXidEpoch; /* nextXID & epoch of latest checkpoint */
TransactionId ckptXid; TransactionId ckptXid;
XLogRecPtr asyncCommitLSN; /* LSN of newest async commit */ XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
uint32 lastRemovedLog; /* latest removed/recycled XLOG segment */ uint32 lastRemovedLog; /* latest removed/recycled XLOG segment */
uint32 lastRemovedSeg; uint32 lastRemovedSeg;
...@@ -1874,18 +1874,18 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch) ...@@ -1874,18 +1874,18 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
} }
/* /*
* Record the LSN for an asynchronous transaction commit. * Record the LSN for an asynchronous transaction commit/abort.
* (This should not be called for aborts, nor for synchronous commits.) * (This should not be called for for synchronous commits.)
*/ */
void void
XLogSetAsyncCommitLSN(XLogRecPtr asyncCommitLSN) XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN)
{ {
/* use volatile pointer to prevent code rearrangement */ /* use volatile pointer to prevent code rearrangement */
volatile XLogCtlData *xlogctl = XLogCtl; volatile XLogCtlData *xlogctl = XLogCtl;
SpinLockAcquire(&xlogctl->info_lck); SpinLockAcquire(&xlogctl->info_lck);
if (XLByteLT(xlogctl->asyncCommitLSN, asyncCommitLSN)) if (XLByteLT(xlogctl->asyncXactLSN, asyncXactLSN))
xlogctl->asyncCommitLSN = asyncCommitLSN; xlogctl->asyncXactLSN = asyncXactLSN;
SpinLockRelease(&xlogctl->info_lck); SpinLockRelease(&xlogctl->info_lck);
} }
...@@ -2134,7 +2134,7 @@ XLogBackgroundFlush(void) ...@@ -2134,7 +2134,7 @@ XLogBackgroundFlush(void)
volatile XLogCtlData *xlogctl = XLogCtl; volatile XLogCtlData *xlogctl = XLogCtl;
SpinLockAcquire(&xlogctl->info_lck); SpinLockAcquire(&xlogctl->info_lck);
WriteRqstPtr = xlogctl->asyncCommitLSN; WriteRqstPtr = xlogctl->asyncXactLSN;
SpinLockRelease(&xlogctl->info_lck); SpinLockRelease(&xlogctl->info_lck);
flexible = false; /* ensure it all gets written */ flexible = false; /* ensure it all gets written */
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.114 2010/07/03 20:43:58 tgl Exp $ * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.115 2010/07/29 22:27:27 sriggs Exp $
*/ */
#ifndef XLOG_H #ifndef XLOG_H
#define XLOG_H #define XLOG_H
...@@ -271,7 +271,7 @@ extern int XLogFileOpen(uint32 log, uint32 seg); ...@@ -271,7 +271,7 @@ extern int XLogFileOpen(uint32 log, uint32 seg);
extern void XLogGetLastRemoved(uint32 *log, uint32 *seg); extern void XLogGetLastRemoved(uint32 *log, uint32 *seg);
extern void XLogSetAsyncCommitLSN(XLogRecPtr record); extern void XLogSetAsyncXactLSN(XLogRecPtr record);
extern void RestoreBkpBlocks(XLogRecPtr lsn, XLogRecord *record, bool cleanup); extern void RestoreBkpBlocks(XLogRecPtr lsn, XLogRecord *record, bool cleanup);
......
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