1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

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.
This commit is contained in:
Tom Lane
2004-09-16 18:35:23 +00:00
parent 8f9f198603
commit 86fff990b2
5 changed files with 41 additions and 27 deletions

View File

@ -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));