1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +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:
Tom Lane
2005-02-20 21:46:50 +00:00
parent 57e3b0c9db
commit 4aefe75553
6 changed files with 17 additions and 65 deletions

View File

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