8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.44 2001/05/14 20:30:19 momjian Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/transam.c,v 1.45 2001/07/12 04:11:13 tgl Exp $
12
12
*
13
13
* NOTES
14
14
* This file contains the high level access-method interface to the
24
24
#include "catalog/catname.h"
25
25
#include "miscadmin.h"
26
26
27
+
27
28
static int RecoveryCheckingEnabled (void );
28
29
static void TransRecover (Relation logRelation );
29
30
static bool TransactionLogTest (TransactionId transactionId , XidStatus status );
@@ -40,29 +41,11 @@ static void TransactionLogUpdate(TransactionId transactionId,
40
41
Relation LogRelation = (Relation ) NULL ;
41
42
42
43
/* ----------------
43
- * global variables holding cached transaction id's and statuses.
44
- * ----------------
45
- */
46
- TransactionId cachedTestXid ;
47
- XidStatus cachedTestXidStatus ;
48
-
49
- /* ----------------
50
- * transaction system constants
44
+ * Single-item cache for results of TransactionLogTest.
51
45
* ----------------
52
46
*/
53
- /* ----------------------------------------------------------------
54
- * transaction system constants
55
- *
56
- * read the comments for GetNewTransactionId in order to
57
- * understand the initial values for AmiTransactionId and
58
- * FirstTransactionId. -cim 3/23/90
59
- * ----------------------------------------------------------------
60
- */
61
- TransactionId NullTransactionId = (TransactionId ) 0 ;
62
-
63
- TransactionId AmiTransactionId = (TransactionId ) 512 ;
64
-
65
- TransactionId FirstTransactionId = (TransactionId ) 514 ;
47
+ static TransactionId cachedTestXid = NullTransactionId ;
48
+ static XidStatus cachedTestXidStatus ;
66
49
67
50
/* ----------------
68
51
* transaction recovery state variables
@@ -76,7 +59,7 @@ TransactionId FirstTransactionId = (TransactionId) 514;
76
59
* goes from zero to one. -cim 3/21/90
77
60
* ----------------
78
61
*/
79
- int RecoveryCheckingEnableState = 0 ;
62
+ static int RecoveryCheckingEnableState = 0 ;
80
63
81
64
/* ----------------
82
65
* recovery checking accessors
@@ -203,14 +186,9 @@ TransactionLogUpdate(TransactionId transactionId, /* trans id to update */
203
186
204
187
/*
205
188
* update (invalidate) our single item TransactionLogTest cache.
206
- *
207
- * if (status != XID_COMMIT)
208
- *
209
- * What's the hell ?! Why != XID_COMMIT ?!
210
189
*/
211
190
TransactionIdStore (transactionId , & cachedTestXid );
212
191
cachedTestXidStatus = status ;
213
-
214
192
}
215
193
216
194
/* ----------------------------------------------------------------
@@ -355,17 +333,15 @@ InitializeTransactionLog(void)
355
333
356
334
/*
357
335
* if we have a virgin database, we initialize the log relation by
358
- * committing the AmiTransactionId (id 512) and we initialize the
336
+ * committing the AmiTransactionId and we initialize the
359
337
* variable relation by setting the next available transaction id to
360
- * FirstTransactionId (id 514) . OID initialization happens as a side
338
+ * FirstTransactionId. OID initialization happens as a side
361
339
* effect of bootstrapping in varsup.c.
362
340
*/
363
341
SpinAcquire (OidGenLockId );
364
342
if (!TransactionIdDidCommit (AmiTransactionId ))
365
343
{
366
344
TransactionLogUpdate (AmiTransactionId , XID_COMMIT );
367
- TransactionIdStore (AmiTransactionId , & cachedTestXid );
368
- cachedTestXidStatus = XID_COMMIT ;
369
345
Assert (!IsUnderPostmaster &&
370
346
ShmemVariableCache -> nextXid <= FirstTransactionId );
371
347
ShmemVariableCache -> nextXid = FirstTransactionId ;
0 commit comments