mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
Remove some no-longer-needed kluges for bootstrapping, in particular
the AMI_OVERRIDE flag. The fact that TransactionLogFetch treats BootstrapTransactionId as always committed is sufficient to make bootstrap work, and getting rid of extra tests in heavily used code paths seems like a win. The files produced by initdb are demonstrably the same after this change.
This commit is contained in:
@ -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);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user