@@ -36,6 +36,7 @@ static bool getRecordTimestamp(XLogReaderState *record, TimestampTz *recordXtime
36
36
static int xlogreadfd = -1 ;
37
37
static XLogSegNo xlogreadsegno = -1 ;
38
38
static char xlogfpath [MAXPGPATH ];
39
+ static bool xlogexists = false;
39
40
40
41
typedef struct XLogPageReadPrivate
41
42
{
@@ -98,6 +99,7 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
98
99
{
99
100
close (xlogreadfd );
100
101
xlogreadfd = -1 ;
102
+ xlogexists = false;
101
103
}
102
104
}
103
105
@@ -192,9 +194,9 @@ validate_wal(pgBackup *backup,
192
194
if (xlogfpath [0 ]!= 0 )
193
195
{
194
196
/* XLOG reader couldnt read WAL segment */
195
- if (xlogreadfd < 0 )
197
+ if (! xlogexists )
196
198
elog (WARNING ,"WAL segment \"%s\" is absent" ,xlogfpath );
197
- else
199
+ else if ( xlogreadfd != -1 )
198
200
elog (WARNING ,"error was occured during reading WAL segment \"%s\"" ,
199
201
xlogfpath );
200
202
}
@@ -232,6 +234,7 @@ validate_wal(pgBackup *backup,
232
234
{
233
235
close (xlogreadfd );
234
236
xlogreadfd = -1 ;
237
+ xlogexists = false;
235
238
}
236
239
}
237
240
@@ -256,6 +259,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
256
259
{
257
260
close (xlogreadfd );
258
261
xlogreadfd = -1 ;
262
+ xlogexists = false;
259
263
}
260
264
261
265
XLByteToSeg (targetPagePtr ,xlogreadsegno );
@@ -272,11 +276,12 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
272
276
{
273
277
elog (LOG ,"opening WAL segment \"%s\"" ,xlogfpath );
274
278
279
+ xlogexists = true;
275
280
xlogreadfd = open (xlogfpath ,O_RDONLY |PG_BINARY ,0 );
276
281
277
282
if (xlogreadfd < 0 )
278
283
{
279
- elog (INFO ,"could not open WAL segment \"%s\": %s" ,
284
+ elog (WARNING ,"could not open WAL segment \"%s\": %s" ,
280
285
xlogfpath ,strerror (errno ));
281
286
return -1 ;
282
287
}