Skip to content

Commit 5b8bd05

Browse files
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.
1 parent 478a2c1 commit 5b8bd05

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/backend/access/transam/xact.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.294 2010/07/23 00:43:00 rhaas Exp $
13+
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.295 2010/07/29 22:27:27 sriggs Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1086,7 +1086,7 @@ RecordTransactionCommit(void)
10861086
* Report the latest async commit LSN, so that the WAL writer knows to
10871087
* flush this commit.
10881088
*/
1089-
XLogSetAsyncCommitLSN(XactLastRecEnd);
1089+
XLogSetAsyncXactLSN(XactLastRecEnd);
10901090

10911091
/*
10921092
* We must not immediately update the CLOG, since we didn't flush the
@@ -1384,7 +1384,7 @@ RecordTransactionAbort(bool isSubXact)
13841384
* problems occur at that point.
13851385
*/
13861386
if (!isSubXact)
1387-
XLogSetAsyncCommitLSN(XactLastRecEnd);
1387+
XLogSetAsyncXactLSN(XactLastRecEnd);
13881388

13891389
/*
13901390
* Mark the transaction aborted in clog. This is not absolutely necessary

src/backend/access/transam/xlog.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.430 2010/07/06 19:18:55 momjian Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.431 2010/07/29 22:27:27 sriggs Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -362,7 +362,7 @@ typedef struct XLogCtlData
362362
XLogwrtResult LogwrtResult;
363363
uint32 ckptXidEpoch; /* nextXID & epoch of latest checkpoint */
364364
TransactionId ckptXid;
365-
XLogRecPtr asyncCommitLSN; /* LSN of newest async commit */
365+
XLogRecPtr asyncXactLSN; /* LSN of newest async commit/abort */
366366
uint32 lastRemovedLog; /* latest removed/recycled XLOG segment */
367367
uint32 lastRemovedSeg;
368368

@@ -1874,18 +1874,18 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible, bool xlog_switch)
18741874
}
18751875

18761876
/*
1877-
* Record the LSN for an asynchronous transaction commit.
1878-
* (This should not be called for aborts, nor for synchronous commits.)
1877+
* Record the LSN for an asynchronous transaction commit/abort.
1878+
* (This should not be called for for synchronous commits.)
18791879
*/
18801880
void
1881-
XLogSetAsyncCommitLSN(XLogRecPtr asyncCommitLSN)
1881+
XLogSetAsyncXactLSN(XLogRecPtr asyncXactLSN)
18821882
{
18831883
/* use volatile pointer to prevent code rearrangement */
18841884
volatile XLogCtlData *xlogctl = XLogCtl;
18851885

18861886
SpinLockAcquire(&xlogctl->info_lck);
1887-
if (XLByteLT(xlogctl->asyncCommitLSN, asyncCommitLSN))
1888-
xlogctl->asyncCommitLSN = asyncCommitLSN;
1887+
if (XLByteLT(xlogctl->asyncXactLSN, asyncXactLSN))
1888+
xlogctl->asyncXactLSN = asyncXactLSN;
18891889
SpinLockRelease(&xlogctl->info_lck);
18901890
}
18911891

@@ -2134,7 +2134,7 @@ XLogBackgroundFlush(void)
21342134
volatile XLogCtlData *xlogctl = XLogCtl;
21352135

21362136
SpinLockAcquire(&xlogctl->info_lck);
2137-
WriteRqstPtr = xlogctl->asyncCommitLSN;
2137+
WriteRqstPtr = xlogctl->asyncXactLSN;
21382138
SpinLockRelease(&xlogctl->info_lck);
21392139
flexible = false; /* ensure it all gets written */
21402140
}

src/include/access/xlog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.114 2010/07/03 20:43:58 tgl Exp $
9+
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.115 2010/07/29 22:27:27 sriggs Exp $
1010
*/
1111
#ifndef XLOG_H
1212
#define XLOG_H
@@ -271,7 +271,7 @@ extern int XLogFileOpen(uint32 log, uint32 seg);
271271

272272

273273
extern void XLogGetLastRemoved(uint32 *log, uint32 *seg);
274-
extern void XLogSetAsyncCommitLSN(XLogRecPtr record);
274+
extern void XLogSetAsyncXactLSN(XLogRecPtr record);
275275

276276
extern void RestoreBkpBlocks(XLogRecPtr lsn, XLogRecord *record, bool cleanup);
277277

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy