diff options
Diffstat (limited to 'src/backend/access/transam')
-rw-r--r-- | src/backend/access/transam/transam.c | 38 | ||||
-rw-r--r-- | src/backend/access/transam/varsup.c | 4 | ||||
-rw-r--r-- | src/backend/access/transam/xact.c | 21 |
3 files changed, 14 insertions, 49 deletions
diff --git a/src/backend/access/transam/transam.c b/src/backend/access/transam/transam.c index 8582a3c1be8..f88c25a37db 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.63 2004/12/31 21:59:29 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/transam.c,v 1.64 2005/02/20 21:46:48 tgl Exp $ * * NOTES * This file contains the high level access-method interface to the @@ -25,18 +25,6 @@ #include "utils/tqual.h" -/* ---------------- - * Flag indicating that we are bootstrapping. - * - * Transaction ID generation is disabled during bootstrap; we just use - * BootstrapTransactionId. Also, the transaction ID status-check routines - * are short-circuited; they claim that BootstrapTransactionId has already - * committed, allowing tuples already inserted to be seen immediately. - * ---------------- - */ -bool AMI_OVERRIDE = false; - - static XidStatus TransactionLogFetch(TransactionId transactionId); static void TransactionLogUpdate(TransactionId transactionId, XidStatus status); @@ -134,18 +122,6 @@ TransactionLogMultiUpdate(int nxids, TransactionId *xids, XidStatus status) TransactionIdSetStatus(xids[i], status); } -/* -------------------------------- - * AmiTransactionOverride - * - * This function is used to manipulate the bootstrap flag. - * -------------------------------- - */ -void -AmiTransactionOverride(bool flag) -{ - AMI_OVERRIDE = flag; -} - /* ---------------------------------------------------------------- * Interface functions * @@ -184,12 +160,6 @@ TransactionIdDidCommit(TransactionId transactionId) { XidStatus xidstatus; - if (AMI_OVERRIDE) - { - Assert(transactionId == BootstrapTransactionId); - return true; - } - xidstatus = TransactionLogFetch(transactionId); /* @@ -233,12 +203,6 @@ TransactionIdDidAbort(TransactionId transactionId) { XidStatus xidstatus; - if (AMI_OVERRIDE) - { - Assert(transactionId == BootstrapTransactionId); - return false; - } - xidstatus = TransactionLogFetch(transactionId); /* diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index eb7aeba3818..8caa7638335 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -6,7 +6,7 @@ * Copyright (c) 2000-2005, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.61 2005/02/20 02:21:28 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.62 2005/02/20 21:46:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ GetNewTransactionId(bool isSubXact) * During bootstrap initialization, we return the special bootstrap * transaction id. */ - if (AMI_OVERRIDE) + if (IsBootstrapProcessingMode()) return BootstrapTransactionId; LWLockAcquire(XidGenLock, LW_EXCLUSIVE); diff --git a/src/backend/access/transam/xact.c b/src/backend/access/transam/xact.c index 5813faeea75..5c84bb99554 100644 --- a/src/backend/access/transam/xact.c +++ b/src/backend/access/transam/xact.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.196 2005/02/20 02:21:28 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.197 2005/02/20 21:46:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -450,22 +450,23 @@ GetCurrentTransactionNestLevel(void) /* * TransactionIdIsCurrentTransactionId - * - * During bootstrap, we cheat and say "it's not my transaction ID" even though - * it is. Along with transam.c's cheat to say that the bootstrap XID is - * already committed, this causes the tqual.c routines to see previously - * inserted tuples as committed, which is what we need during bootstrap. */ bool TransactionIdIsCurrentTransactionId(TransactionId xid) { TransactionState s; - if (AMI_OVERRIDE) - { - Assert(xid == BootstrapTransactionId); + /* + * We always say that BootstrapTransactionId is "not my transaction ID" + * even when it is (ie, during bootstrap). Along with the fact that + * transam.c always treats BootstrapTransactionId as already committed, + * this causes the tqual.c routines to see all tuples as committed, + * which is what we need during bootstrap. (Bootstrap mode only inserts + * tuples, it never updates or deletes them, so all tuples can be presumed + * good immediately.) + */ + if (xid == BootstrapTransactionId) return false; - } /* * We will return true for the Xid of the current subtransaction, any |