diff options
author | Tom Lane | 2004-09-16 18:35:23 +0000 |
---|---|---|
committer | Tom Lane | 2004-09-16 18:35:23 +0000 |
commit | 86fff990b2acdbbfaf4340636878313fe270c916 (patch) | |
tree | 1bb9b083366b630a2a835f124b6ad3167b7ab86d /src/backend/access | |
parent | 8f9f1986034a2273e09ad10671e10d1adda21d1f (diff) |
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.
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/transam/subtrans.c | 14 | ||||
-rw-r--r-- | src/backend/access/transam/transam.c | 14 |
2 files changed, 14 insertions, 14 deletions
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) diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c index f82168be5b7..648fae14011 100644 --- a/src/backend/access/transam/transam.c +++ b/src/backend/access/transam/transam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/transam.c,v 1.61 2004/08/29 05:06:40 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/transam.c,v 1.62 2004/09/16 18:35:20 tgl Exp $ * * NOTES * This file contains the high level access-method interface to the @@ -200,15 +200,15 @@ TransactionIdDidCommit(TransactionId transactionId) /* * If it's marked subcommitted, we have to check the parent - * recursively. However, if it's older than RecentXmin, we can't look - * at pg_subtrans; instead assume that the parent crashed without + * recursively. However, if it's older than TransactionXmin, we can't + * look at pg_subtrans; instead assume that the parent crashed without * cleaning up its children. */ if (xidstatus == TRANSACTION_STATUS_SUB_COMMITTED) { TransactionId parentXid; - if (TransactionIdPrecedes(transactionId, RecentXmin)) + if (TransactionIdPrecedes(transactionId, TransactionXmin)) return false; parentXid = SubTransGetParent(transactionId); Assert(TransactionIdIsValid(parentXid)); @@ -249,15 +249,15 @@ TransactionIdDidAbort(TransactionId transactionId) /* * If it's marked subcommitted, we have to check the parent - * recursively. However, if it's older than RecentXmin, we can't look - * at pg_subtrans; instead assume that the parent crashed without + * recursively. However, if it's older than TransactionXmin, we can't + * look at pg_subtrans; instead assume that the parent crashed without * cleaning up its children. */ if (xidstatus == TRANSACTION_STATUS_SUB_COMMITTED) { TransactionId parentXid; - if (TransactionIdPrecedes(transactionId, RecentXmin)) + if (TransactionIdPrecedes(transactionId, TransactionXmin)) return true; parentXid = SubTransGetParent(transactionId); Assert(TransactionIdIsValid(parentXid)); |