From 86fff990b2acdbbfaf4340636878313fe270c916 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 16 Sep 2004 18:35:23 +0000 Subject: RecentXmin is too recent to use as the cutoff point for accessing pg_subtrans --- what we need is the oldest xmin of any snapshot in use in the current top transaction. Introduce a new variable TransactionXmin to play this role. Fixes intermittent regression failure reported by Neil Conway. --- src/backend/access/transam/subtrans.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/backend/access/transam/subtrans.c') diff --git a/src/backend/access/transam/subtrans.c b/src/backend/access/transam/subtrans.c index 93a586148be..f8303ae1cff 100644 --- a/src/backend/access/transam/subtrans.c +++ b/src/backend/access/transam/subtrans.c @@ -22,7 +22,7 @@ * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.5 2004/08/29 05:06:40 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/subtrans.c,v 1.6 2004/09/16 18:35:20 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -105,7 +105,7 @@ SubTransGetParent(TransactionId xid) TransactionId parent; /* Can't ask about stuff that might not be around anymore */ - Assert(TransactionIdFollowsOrEquals(xid, RecentXmin)); + Assert(TransactionIdFollowsOrEquals(xid, TransactionXmin)); /* Bootstrap and frozen XIDs have no parent */ if (!TransactionIdIsNormal(xid)) @@ -129,12 +129,12 @@ SubTransGetParent(TransactionId xid) * * Returns the topmost transaction of the given transaction id. * - * Because we cannot look back further than RecentXmin, it is possible + * Because we cannot look back further than TransactionXmin, it is possible * that this function will lie and return an intermediate subtransaction ID * instead of the true topmost parent ID. This is OK, because in practice * we only care about detecting whether the topmost parent is still running * or is part of a current snapshot's list of still-running transactions. - * Therefore, any XID before RecentXmin is as good as any other. + * Therefore, any XID before TransactionXmin is as good as any other. */ TransactionId SubTransGetTopmostTransaction(TransactionId xid) @@ -143,12 +143,12 @@ SubTransGetTopmostTransaction(TransactionId xid) previousXid = xid; /* Can't ask about stuff that might not be around anymore */ - Assert(TransactionIdFollowsOrEquals(xid, RecentXmin)); + Assert(TransactionIdFollowsOrEquals(xid, TransactionXmin)); while (TransactionIdIsValid(parentXid)) { previousXid = parentXid; - if (TransactionIdPrecedes(parentXid, RecentXmin)) + if (TransactionIdPrecedes(parentXid, TransactionXmin)) break; parentXid = SubTransGetParent(parentXid); } @@ -312,7 +312,7 @@ ExtendSUBTRANS(TransactionId newestXact) * Remove all SUBTRANS segments before the one holding the passed transaction ID * * This is normally called during checkpoint, with oldestXact being the - * oldest XMIN of any running transaction. + * oldest TransactionXmin of any running transaction. */ void TruncateSUBTRANS(TransactionId oldestXact) -- cgit v1.2.3