@@ -433,7 +433,6 @@ typedef struct XLogCtlData
433
433
* recovery. Protected by info_lck.
434
434
*/
435
435
bool SharedRecoveryInProgress ;
436
- bool SharedInArchiveRecovery ;
437
436
438
437
/*
439
438
* SharedHotStandbyActive indicates if we're still in crash or archive
@@ -620,7 +619,6 @@ static bool bgwriterLaunched = false;
620
619
621
620
static void readRecoveryCommandFile (void );
622
621
static void exitArchiveRecovery (TimeLineID endTLI , XLogSegNo endLogSegNo );
623
- static bool ArchiveRecoveryInProgress (void );
624
622
static bool recoveryStopsHere (XLogRecord * record , bool * includeThis );
625
623
static void recoveryPausesHere (void );
626
624
static void SetLatestXTime (TimestampTz xtime );
@@ -2925,7 +2923,7 @@ RemoveOldXlogFiles(XLogSegNo segno, XLogRecPtr endptr)
2925
2923
strspn (xlde -> d_name , "0123456789ABCDEF" ) == 24 &&
2926
2924
strcmp (xlde -> d_name + 8 , lastoff + 8 ) <= 0 )
2927
2925
{
2928
- if (ArchiveRecoveryInProgress () || XLogArchiveCheckDone (xlde -> d_name ))
2926
+ if (XLogArchiveCheckDone (xlde -> d_name ))
2929
2927
{
2930
2928
snprintf (path , MAXPGPATH , XLOGDIR "/%s" , xlde -> d_name );
2931
2929
@@ -3871,7 +3869,6 @@ XLOGShmemInit(void)
3871
3869
*/
3872
3870
XLogCtl -> XLogCacheBlck = XLOGbuffers - 1 ;
3873
3871
XLogCtl -> SharedRecoveryInProgress = true;
3874
- XLogCtl -> SharedInArchiveRecovery = false;
3875
3872
XLogCtl -> SharedHotStandbyActive = false;
3876
3873
XLogCtl -> WalWriterSleeping = false;
3877
3874
XLogCtl -> Insert .currpage = (XLogPageHeader ) (XLogCtl -> pages );
@@ -4265,7 +4262,6 @@ readRecoveryCommandFile(void)
4265
4262
4266
4263
/* Enable fetching from archive recovery area */
4267
4264
InArchiveRecovery = true;
4268
- XLogCtl -> SharedInArchiveRecovery = true;
4269
4265
4270
4266
/*
4271
4267
* If user specified recovery_target_timeline, validate it or compute the
@@ -4304,16 +4300,11 @@ exitArchiveRecovery(TimeLineID endTLI, XLogSegNo endLogSegNo)
4304
4300
{
4305
4301
char recoveryPath [MAXPGPATH ];
4306
4302
char xlogpath [MAXPGPATH ];
4307
- /* use volatile pointer to prevent code rearrangement */
4308
- volatile XLogCtlData * xlogctl = XLogCtl ;
4309
4303
4310
4304
/*
4311
4305
* We are no longer in archive recovery state.
4312
4306
*/
4313
4307
InArchiveRecovery = false;
4314
- SpinLockAcquire (& xlogctl -> info_lck );
4315
- xlogctl -> SharedInArchiveRecovery = false;
4316
- SpinLockRelease (& xlogctl -> info_lck );
4317
4308
4318
4309
/*
4319
4310
* Update min recovery point one last time.
@@ -6110,25 +6101,6 @@ RecoveryInProgress(void)
6110
6101
}
6111
6102
}
6112
6103
6113
- /*
6114
- * Are we currently in archive recovery? In the startup process, you can just
6115
- * check InArchiveRecovery variable instead.
6116
- */
6117
- static bool
6118
- ArchiveRecoveryInProgress ()
6119
- {
6120
- bool result ;
6121
- /* use volatile pointer to prevent code rearrangement */
6122
- volatile XLogCtlData * xlogctl = XLogCtl ;
6123
-
6124
- /* spinlock is essential on machines with weak memory ordering! */
6125
- SpinLockAcquire (& xlogctl -> info_lck );
6126
- result = xlogctl -> SharedInArchiveRecovery ;
6127
- SpinLockRelease (& xlogctl -> info_lck );
6128
-
6129
- return result ;
6130
- }
6131
-
6132
6104
/*
6133
6105
* Is HotStandby active yet? This is only important in special backends
6134
6106
* since normal backends won't ever be able to connect until this returns
0 commit comments