@@ -795,7 +795,7 @@ static int readFile = -1;
795
795
static XLogSegNo readSegNo = 0 ;
796
796
static uint32 readOff = 0 ;
797
797
static uint32 readLen = 0 ;
798
- static XLogSource readSource = 0 ; /* XLOG_FROM_* code */
798
+ static XLogSource readSource = XLOG_FROM_ANY ;
799
799
800
800
/*
801
801
* Keeps track of which source we're currently reading from. This is
@@ -804,7 +804,7 @@ static XLogSource readSource = 0; /* XLOG_FROM_* code */
804
804
* attempt to read from currentSource failed, and we should try another source
805
805
* next.
806
806
*/
807
- static XLogSource currentSource = 0 ; /* XLOG_FROM_* code */
807
+ static XLogSource currentSource = XLOG_FROM_ANY ;
808
808
static bool lastSourceFailed = false;
809
809
810
810
typedef struct XLogPageReadPrivate
@@ -823,7 +823,7 @@ typedef struct XLogPageReadPrivate
823
823
* XLogReceiptSource tracks where we last successfully read some WAL.)
824
824
*/
825
825
static TimestampTz XLogReceiptTime = 0 ;
826
- static XLogSource XLogReceiptSource = 0 ; /* XLOG_FROM_* code */
826
+ static XLogSource XLogReceiptSource = XLOG_FROM_ANY ;
827
827
828
828
/* State information for XLOG reading */
829
829
static XLogRecPtr ReadRecPtr ; /* start of last record read */
@@ -886,8 +886,8 @@ static bool InstallXLogFileSegment(XLogSegNo *segno, char *tmppath,
886
886
bool find_free , XLogSegNo max_segno ,
887
887
bool use_lock );
888
888
static int XLogFileRead (XLogSegNo segno , int emode , TimeLineID tli ,
889
- int source , bool notfoundOk );
890
- static int XLogFileReadAnyTLI (XLogSegNo segno , int emode , int source );
889
+ XLogSource source , bool notfoundOk );
890
+ static int XLogFileReadAnyTLI (XLogSegNo segno , int emode , XLogSource source );
891
891
static int XLogPageRead (XLogReaderState * xlogreader , XLogRecPtr targetPagePtr ,
892
892
int reqLen , XLogRecPtr targetRecPtr , char * readBuf );
893
893
static bool WaitForWALToBecomeAvailable (XLogRecPtr RecPtr , bool randAccess ,
@@ -3633,7 +3633,7 @@ XLogFileOpen(XLogSegNo segno)
3633
3633
*/
3634
3634
static int
3635
3635
XLogFileRead (XLogSegNo segno , int emode , TimeLineID tli ,
3636
- int source , bool notfoundOk )
3636
+ XLogSource source , bool notfoundOk )
3637
3637
{
3638
3638
char xlogfname [MAXFNAMELEN ];
3639
3639
char activitymsg [MAXFNAMELEN + 16 ];
@@ -3715,7 +3715,7 @@ XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
3715
3715
* This version searches for the segment with any TLI listed in expectedTLEs.
3716
3716
*/
3717
3717
static int
3718
- XLogFileReadAnyTLI (XLogSegNo segno , int emode , int source )
3718
+ XLogFileReadAnyTLI (XLogSegNo segno , int emode , XLogSource source )
3719
3719
{
3720
3720
char path [MAXPGPATH ];
3721
3721
ListCell * cell ;
@@ -4387,7 +4387,7 @@ ReadRecord(XLogReaderState *xlogreader, int emode,
4387
4387
* so that we will check the archive next.
4388
4388
*/
4389
4389
lastSourceFailed = false;
4390
- currentSource = 0 ;
4390
+ currentSource = XLOG_FROM_ANY ;
4391
4391
4392
4392
continue ;
4393
4393
}
@@ -11673,7 +11673,7 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen,
11673
11673
11674
11674
close (readFile );
11675
11675
readFile = -1 ;
11676
- readSource = 0 ;
11676
+ readSource = XLOG_FROM_ANY ;
11677
11677
}
11678
11678
11679
11679
XLByteToSeg (targetPagePtr , readSegNo , wal_segment_size );
@@ -11693,7 +11693,7 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen,
11693
11693
close (readFile );
11694
11694
readFile = -1 ;
11695
11695
readLen = 0 ;
11696
- readSource = 0 ;
11696
+ readSource = XLOG_FROM_ANY ;
11697
11697
11698
11698
return -1 ;
11699
11699
}
@@ -11799,7 +11799,7 @@ XLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr, int reqLen,
11799
11799
close (readFile );
11800
11800
readFile = -1 ;
11801
11801
readLen = 0 ;
11802
- readSource = 0 ;
11802
+ readSource = XLOG_FROM_ANY ;
11803
11803
11804
11804
/* In standby-mode, keep trying */
11805
11805
if (StandbyMode )
@@ -11870,7 +11870,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
11870
11870
*/
11871
11871
if (!InArchiveRecovery )
11872
11872
currentSource = XLOG_FROM_PG_WAL ;
11873
- else if (currentSource == 0 ||
11873
+ else if (currentSource == XLOG_FROM_ANY ||
11874
11874
(!StandbyMode && currentSource == XLOG_FROM_STREAM ))
11875
11875
{
11876
11876
lastSourceFailed = false;
@@ -11879,7 +11879,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess,
11879
11879
11880
11880
for (;;)
11881
11881
{
11882
- int oldSource = currentSource ;
11882
+ XLogSource oldSource = currentSource ;
11883
11883
11884
11884
/*
11885
11885
* First check if we failed to read from the current source, and
0 commit comments