@@ -36,6 +36,7 @@ static bool getRecordTimestamp(XLogReaderState *record, TimestampTz *recordXtime
3636static int xlogreadfd = -1 ;
3737static XLogSegNo xlogreadsegno = -1 ;
3838static char xlogfpath [MAXPGPATH ];
39+ static bool xlogexists = false;
3940
4041typedef struct XLogPageReadPrivate
4142{
@@ -98,6 +99,7 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
9899{
99100close (xlogreadfd );
100101xlogreadfd = -1 ;
102+ xlogexists = false;
101103}
102104}
103105
@@ -192,9 +194,9 @@ validate_wal(pgBackup *backup,
192194if (xlogfpath [0 ]!= 0 )
193195{
194196/* XLOG reader couldnt read WAL segment */
195- if (xlogreadfd < 0 )
197+ if (! xlogexists )
196198elog (WARNING ,"WAL segment \"%s\" is absent" ,xlogfpath );
197- else
199+ else if ( xlogreadfd != -1 )
198200elog (WARNING ,"error was occured during reading WAL segment \"%s\"" ,
199201xlogfpath );
200202}
@@ -232,6 +234,7 @@ validate_wal(pgBackup *backup,
232234{
233235close (xlogreadfd );
234236xlogreadfd = -1 ;
237+ xlogexists = false;
235238}
236239}
237240
@@ -256,6 +259,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
256259{
257260close (xlogreadfd );
258261xlogreadfd = -1 ;
262+ xlogexists = false;
259263}
260264
261265XLByteToSeg (targetPagePtr ,xlogreadsegno );
@@ -272,11 +276,12 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
272276{
273277elog (LOG ,"opening WAL segment \"%s\"" ,xlogfpath );
274278
279+ xlogexists = true;
275280xlogreadfd = open (xlogfpath ,O_RDONLY |PG_BINARY ,0 );
276281
277282if (xlogreadfd < 0 )
278283{
279- elog (INFO ,"could not open WAL segment \"%s\": %s" ,
284+ elog (WARNING ,"could not open WAL segment \"%s\": %s" ,
280285xlogfpath ,strerror (errno ));
281286return -1 ;
282287}