From: Simon Riggs Date: Mon, 5 Oct 2009 13:31:07 +0000 (+0100) Subject: Apply 0008-Don-t-try-to-pin-and-lock-every-page-in-replay-of-b-.patch X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dd5ebdee1687974ab1fa3814cca592a2776b4f73;p=users%2Fsimon%2Fpostgres.git Apply 0008-Don-t-try-to-pin-and-lock-every-page-in-replay-of-b-.patch All Good. --- diff --git a/src/backend/access/nbtree/nbtxlog.c b/src/backend/access/nbtree/nbtxlog.c index 6b78781b94..858a8fbba6 100644 --- a/src/backend/access/nbtree/nbtxlog.c +++ b/src/backend/access/nbtree/nbtxlog.c @@ -478,7 +478,7 @@ btree_xlog_vacuum(XLogRecPtr lsn, XLogRecord *record) * This ensures that every block in the index is touched during * VACUUM as required to ensure scans work correctly. */ - if ((xlrec->lastBlockVacuumed + 1) != xlrec->block) + if (InHotStandby && (xlrec->lastBlockVacuumed + 1) != xlrec->block) { BlockNumber blkno = xlrec->lastBlockVacuumed + 1; diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 53abc32da1..0211d8c28d 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -219,11 +219,6 @@ static bool forceSyncCommit = false; */ static MemoryContext TransactionAbortContext = NULL; -/* - * Local state to optimise recovery conflict resolution - */ -static TransactionId latestRemovedXid = InvalidTransactionId; - /* * List of add-on start- and end-of-xact callbacks */ @@ -4421,28 +4416,6 @@ XactClearRecoveryTransactions(void) RelationReleaseAllRecoveryLocks(); } -/* - * LatestRemovedXidAdvances - returns true if latestRemovedXid is moved - * forwards by the latest provided value - */ -bool -LatestRemovedXidAdvances(TransactionId latestXid) -{ - /* - * Don't bother checking for conflicts for cleanup records earlier than - * we have already tested for. - */ - if (!TransactionIdIsValid(latestRemovedXid) || - (TransactionIdIsValid(latestRemovedXid) && - TransactionIdPrecedes(latestRemovedXid, latestXid))) - { - latestRemovedXid = latestXid; - return true; - } - - return false; -} - /* * XLOG support routines */ diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 9d3c7d1f2c..e8a5c1c866 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -231,7 +231,6 @@ extern int xactGetCommittedChildren(TransactionId **ptr); extern XLogRecPtr LogCurrentRunningXacts(RunningTransactions CurrRunningXacts); extern void InitRecoveryTransactionEnvironment(void); extern void XactClearRecoveryTransactions(void); -extern bool LatestRemovedXidAdvances(TransactionId latestXid); extern void xact_redo(XLogRecPtr lsn, XLogRecord *record); extern void xact_desc(StringInfo buf, uint8 xl_info, char *rec);