mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Tweak code so that pg_subtrans is never consulted for XIDs older than
RecentXmin (== MyProc->xmin). This ensures that it will be safe to truncate pg_subtrans at RecentGlobalXmin, which should largely eliminate any fear of bloat. Along the way, eliminate SubTransXidsHaveCommonAncestor, which isn't really needed and could not give a trustworthy result anyway under the lookback restriction. In an unrelated but nearby change, #ifdef out GetUndoRecPtr, which has been dead code since 2001 and seems unlikely to ever be resurrected.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.68 2004/08/15 17:03:36 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.69 2004/08/22 02:41:57 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -526,7 +526,7 @@ TransactionIdIsInProgress(TransactionId xid)
|
||||
/*
|
||||
* Don't bother checking a very old transaction.
|
||||
*/
|
||||
if (TransactionIdPrecedes(xid, RecentGlobalXmin))
|
||||
if (TransactionIdPrecedes(xid, RecentXmin))
|
||||
{
|
||||
xc_by_recent_xmin_inc();
|
||||
return false;
|
||||
@@ -912,6 +912,7 @@ CountActiveBackends(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
/*
|
||||
* GetUndoRecPtr -- returns oldest PGPROC->logRec.
|
||||
*/
|
||||
@@ -947,6 +948,7 @@ GetUndoRecPtr(void)
|
||||
|
||||
return (urec);
|
||||
}
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/*
|
||||
* BackendIdGetProc - given a BackendId, find its PGPROC structure
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.66 2004/07/28 14:23:29 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/lmgr.c,v 1.67 2004/08/22 02:41:57 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -345,7 +345,7 @@ XactLockTableWait(TransactionId xid)
|
||||
LOCKTAG tag;
|
||||
TransactionId myxid = GetTopTransactionId();
|
||||
|
||||
Assert(!SubTransXidsHaveCommonAncestor(xid, myxid));
|
||||
Assert(!TransactionIdEquals(xid, myxid));
|
||||
|
||||
MemSet(&tag, 0, sizeof(tag));
|
||||
tag.relId = XactLockTableId;
|
||||
|
||||
Reference in New Issue
Block a user