7
7
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.61 2001/03/18 00:30:27 tgl Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.62 2001/03/18 20:18:59 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -2161,7 +2161,6 @@ BootStrapXLOG(void)
2161
2161
checkPoint .time = time (NULL );
2162
2162
2163
2163
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
2164
- ShmemVariableCache -> xidCount = 0 ;
2165
2164
ShmemVariableCache -> nextOid = checkPoint .nextOid ;
2166
2165
ShmemVariableCache -> oidCount = 0 ;
2167
2166
@@ -2317,7 +2316,6 @@ StartupXLOG(void)
2317
2316
elog (STOP , "Invalid NextTransactionId/NextOid" );
2318
2317
2319
2318
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
2320
- ShmemVariableCache -> xidCount = 0 ;
2321
2319
ShmemVariableCache -> nextOid = checkPoint .nextOid ;
2322
2320
ShmemVariableCache -> oidCount = 0 ;
2323
2321
@@ -2368,11 +2366,7 @@ StartupXLOG(void)
2368
2366
do
2369
2367
{
2370
2368
if (record -> xl_xid >= ShmemVariableCache -> nextXid )
2371
- {
2372
- /* This probably shouldn't happen... */
2373
2369
ShmemVariableCache -> nextXid = record -> xl_xid + 1 ;
2374
- ShmemVariableCache -> xidCount = 0 ;
2375
- }
2376
2370
if (XLOG_DEBUG )
2377
2371
{
2378
2372
char buf [8192 ];
@@ -2717,8 +2711,6 @@ CreateCheckPoint(bool shutdown)
2717
2711
2718
2712
SpinAcquire (XidGenLockId );
2719
2713
checkPoint .nextXid = ShmemVariableCache -> nextXid ;
2720
- if (!shutdown )
2721
- checkPoint .nextXid += ShmemVariableCache -> xidCount ;
2722
2714
SpinRelease (XidGenLockId );
2723
2715
2724
2716
SpinAcquire (OidGenLockId );
@@ -2803,21 +2795,6 @@ CreateCheckPoint(bool shutdown)
2803
2795
END_CRIT_SECTION ();
2804
2796
}
2805
2797
2806
- /*
2807
- * Write a NEXTXID log record
2808
- */
2809
- void
2810
- XLogPutNextXid (TransactionId nextXid )
2811
- {
2812
- XLogRecData rdata ;
2813
-
2814
- rdata .buffer = InvalidBuffer ;
2815
- rdata .data = (char * )(& nextXid );
2816
- rdata .len = sizeof (TransactionId );
2817
- rdata .next = NULL ;
2818
- (void ) XLogInsert (RM_XLOG_ID , XLOG_NEXTXID , & rdata );
2819
- }
2820
-
2821
2798
/*
2822
2799
* Write a NEXTOID log record
2823
2800
*/
@@ -2841,18 +2818,7 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
2841
2818
{
2842
2819
uint8 info = record -> xl_info & ~XLR_INFO_MASK ;
2843
2820
2844
- if (info == XLOG_NEXTXID )
2845
- {
2846
- TransactionId nextXid ;
2847
-
2848
- memcpy (& nextXid , XLogRecGetData (record ), sizeof (TransactionId ));
2849
- if (ShmemVariableCache -> nextXid < nextXid )
2850
- {
2851
- ShmemVariableCache -> nextXid = nextXid ;
2852
- ShmemVariableCache -> xidCount = 0 ;
2853
- }
2854
- }
2855
- else if (info == XLOG_NEXTOID )
2821
+ if (info == XLOG_NEXTOID )
2856
2822
{
2857
2823
Oid nextOid ;
2858
2824
@@ -2870,7 +2836,6 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
2870
2836
memcpy (& checkPoint , XLogRecGetData (record ), sizeof (CheckPoint ));
2871
2837
/* In a SHUTDOWN checkpoint, believe the counters exactly */
2872
2838
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
2873
- ShmemVariableCache -> xidCount = 0 ;
2874
2839
ShmemVariableCache -> nextOid = checkPoint .nextOid ;
2875
2840
ShmemVariableCache -> oidCount = 0 ;
2876
2841
}
@@ -2879,11 +2844,10 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
2879
2844
CheckPoint checkPoint ;
2880
2845
2881
2846
memcpy (& checkPoint , XLogRecGetData (record ), sizeof (CheckPoint ));
2882
- /* In an ONLINE checkpoint, treat the counters like NEXTXID/ NEXTOID */
2847
+ /* In an ONLINE checkpoint, treat the counters like NEXTOID */
2883
2848
if (ShmemVariableCache -> nextXid < checkPoint .nextXid )
2884
2849
{
2885
2850
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
2886
- ShmemVariableCache -> xidCount = 0 ;
2887
2851
}
2888
2852
if (ShmemVariableCache -> nextOid < checkPoint .nextOid )
2889
2853
{
@@ -2915,13 +2879,6 @@ xlog_desc(char *buf, uint8 xl_info, char* rec)
2915
2879
checkpoint -> nextOid ,
2916
2880
(info == XLOG_CHECKPOINT_SHUTDOWN ) ? "shutdown" : "online" );
2917
2881
}
2918
- else if (info == XLOG_NEXTXID )
2919
- {
2920
- TransactionId nextXid ;
2921
-
2922
- memcpy (& nextXid , rec , sizeof (TransactionId ));
2923
- sprintf (buf + strlen (buf ), "nextXid: %u" , nextXid );
2924
- }
2925
2882
else if (info == XLOG_NEXTOID )
2926
2883
{
2927
2884
Oid nextOid ;
0 commit comments