@@ -418,7 +418,6 @@ typedef struct XLogCtlData
418
418
* recovery. Protected by info_lck.
419
419
*/
420
420
bool SharedRecoveryInProgress ;
421
- bool SharedInArchiveRecovery ;
422
421
423
422
/*
424
423
* SharedHotStandbyActive indicates if we're still in crash or archive
@@ -623,7 +622,6 @@ static void XLogArchiveCleanup(const char *xlog);
623
622
static void readRecoveryCommandFile (void );
624
623
static void exitArchiveRecovery (TimeLineID endTLI ,
625
624
uint32 endLogId , uint32 endLogSeg );
626
- static bool ArchiveRecoveryInProgress (void );
627
625
static bool recoveryStopsHere (XLogRecord * record , bool * includeThis );
628
626
static void recoveryPausesHere (void );
629
627
static void SetLatestXTime (TimestampTz xtime );
@@ -3573,7 +3571,7 @@ RemoveOldXlogFiles(uint32 log, uint32 seg, XLogRecPtr endptr)
3573
3571
strspn (xlde -> d_name , "0123456789ABCDEF" ) == 24 &&
3574
3572
strcmp (xlde -> d_name + 8 , lastoff + 8 ) <= 0 )
3575
3573
{
3576
- if (ArchiveRecoveryInProgress () || XLogArchiveCheckDone (xlde -> d_name ))
3574
+ if (XLogArchiveCheckDone (xlde -> d_name ))
3577
3575
{
3578
3576
snprintf (path , MAXPGPATH , XLOGDIR "/%s" , xlde -> d_name );
3579
3577
@@ -5291,7 +5289,6 @@ XLOGShmemInit(void)
5291
5289
*/
5292
5290
XLogCtl -> XLogCacheBlck = XLOGbuffers - 1 ;
5293
5291
XLogCtl -> SharedRecoveryInProgress = true;
5294
- XLogCtl -> SharedInArchiveRecovery = false;
5295
5292
XLogCtl -> SharedHotStandbyActive = false;
5296
5293
XLogCtl -> WalWriterSleeping = false;
5297
5294
XLogCtl -> Insert .currpage = (XLogPageHeader ) (XLogCtl -> pages );
@@ -5683,7 +5680,6 @@ readRecoveryCommandFile(void)
5683
5680
5684
5681
/* Enable fetching from archive recovery area */
5685
5682
InArchiveRecovery = true;
5686
- XLogCtl -> SharedInArchiveRecovery = true;
5687
5683
5688
5684
/*
5689
5685
* If user specified recovery_target_timeline, validate it or compute the
@@ -5722,16 +5718,11 @@ exitArchiveRecovery(TimeLineID endTLI, uint32 endLogId, uint32 endLogSeg)
5722
5718
{
5723
5719
char recoveryPath [MAXPGPATH ];
5724
5720
char xlogpath [MAXPGPATH ];
5725
- /* use volatile pointer to prevent code rearrangement */
5726
- volatile XLogCtlData * xlogctl = XLogCtl ;
5727
5721
5728
5722
/*
5729
5723
* We are no longer in archive recovery state.
5730
5724
*/
5731
5725
InArchiveRecovery = false;
5732
- SpinLockAcquire (& xlogctl -> info_lck );
5733
- xlogctl -> SharedInArchiveRecovery = false;
5734
- SpinLockRelease (& xlogctl -> info_lck );
5735
5726
5736
5727
/*
5737
5728
* Update min recovery point one last time.
@@ -7323,25 +7314,6 @@ RecoveryInProgress(void)
7323
7314
}
7324
7315
}
7325
7316
7326
- /*
7327
- * Are we currently in archive recovery? In the startup process, you can just
7328
- * check InArchiveRecovery variable instead.
7329
- */
7330
- static bool
7331
- ArchiveRecoveryInProgress ()
7332
- {
7333
- bool result ;
7334
- /* use volatile pointer to prevent code rearrangement */
7335
- volatile XLogCtlData * xlogctl = XLogCtl ;
7336
-
7337
- /* spinlock is essential on machines with weak memory ordering! */
7338
- SpinLockAcquire (& xlogctl -> info_lck );
7339
- result = xlogctl -> SharedInArchiveRecovery ;
7340
- SpinLockRelease (& xlogctl -> info_lck );
7341
-
7342
- return result ;
7343
- }
7344
-
7345
7317
/*
7346
7318
* Is HotStandby active yet? This is only important in special backends
7347
7319
* since normal backends won't ever be able to connect until this returns
0 commit comments