From 282fdfcdc8a8f987c06e839d581b94bf196def8a Mon Sep 17 00:00:00 2001 From: Joe Conway Date: Mon, 28 Dec 2015 12:35:16 -0800 Subject: Rename (new|old)estCommitTs to (new|old)estCommitTsXid The variables newestCommitTs and oldestCommitTs sound as if they are timestamps, but in fact they are the transaction Ids that correspond to the newest and oldest timestamps rather than the actual timestamps. Rename these variables to reflect that they are actually xids: to wit newestCommitTsXid and oldestCommitTsXid respectively. Also modify related code in a similar fashion, particularly the user facing output emitted by pg_controldata and pg_resetxlog. Complaint and patch by me, review by Tom Lane and Alvaro Herrera. Backpatch to 9.5 where these variables were first introduced. --- src/backend/access/transam/xlog.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 71fc8ffa272..06a361a9ed9 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -4786,8 +4786,8 @@ BootStrapXLOG(void) checkPoint.oldestXidDB = TemplateDbOid; checkPoint.oldestMulti = FirstMultiXactId; checkPoint.oldestMultiDB = TemplateDbOid; - checkPoint.oldestCommitTs = InvalidTransactionId; - checkPoint.newestCommitTs = InvalidTransactionId; + checkPoint.oldestCommitTsXid = InvalidTransactionId; + checkPoint.newestCommitTsXid = InvalidTransactionId; checkPoint.time = (pg_time_t) time(NULL); checkPoint.oldestActiveXid = InvalidTransactionId; @@ -6302,8 +6302,8 @@ StartupXLOG(void) checkPoint.oldestMulti, checkPoint.oldestMultiDB))); ereport(DEBUG1, (errmsg_internal("commit timestamp Xid oldest/newest: %u/%u", - checkPoint.oldestCommitTs, - checkPoint.newestCommitTs))); + checkPoint.oldestCommitTsXid, + checkPoint.newestCommitTsXid))); if (!TransactionIdIsNormal(checkPoint.nextXid)) ereport(PANIC, (errmsg("invalid next transaction ID"))); @@ -6315,8 +6315,8 @@ StartupXLOG(void) MultiXactSetNextMXact(checkPoint.nextMulti, checkPoint.nextMultiOffset); SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB); SetMultiXactIdLimit(checkPoint.oldestMulti, checkPoint.oldestMultiDB); - SetCommitTsLimit(checkPoint.oldestCommitTs, - checkPoint.newestCommitTs); + SetCommitTsLimit(checkPoint.oldestCommitTsXid, + checkPoint.newestCommitTsXid); XLogCtl->ckptXidEpoch = checkPoint.nextXidEpoch; XLogCtl->ckptXid = checkPoint.nextXid; @@ -8334,8 +8334,8 @@ CreateCheckPoint(int flags) LWLockRelease(XidGenLock); LWLockAcquire(CommitTsLock, LW_SHARED); - checkPoint.oldestCommitTs = ShmemVariableCache->oldestCommitTs; - checkPoint.newestCommitTs = ShmemVariableCache->newestCommitTs; + checkPoint.oldestCommitTsXid = ShmemVariableCache->oldestCommitTsXid; + checkPoint.newestCommitTsXid = ShmemVariableCache->newestCommitTsXid; LWLockRelease(CommitTsLock); /* Increase XID epoch if we've wrapped around since last checkpoint */ -- cgit v1.2.3