Skip to content

Commit 8fdbe1e

Browse files
author
Artur Zakirov
committed
Fix message in valid_wal()
1 parent a3e5458 commit 8fdbe1e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

parsexlog.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static bool getRecordTimestamp(XLogReaderState *record, TimestampTz *recordXtime
3636
static int xlogreadfd = -1;
3737
static XLogSegNo xlogreadsegno = -1;
3838
static char xlogfpath[MAXPGPATH];
39+
static bool xlogexists = false;
3940

4041
typedef struct XLogPageReadPrivate
4142
{
@@ -98,6 +99,7 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
9899
{
99100
close(xlogreadfd);
100101
xlogreadfd = -1;
102+
xlogexists = false;
101103
}
102104
}
103105

@@ -192,9 +194,9 @@ validate_wal(pgBackup *backup,
192194
if (xlogfpath[0] != 0)
193195
{
194196
/* XLOG reader couldnt read WAL segment */
195-
if (xlogreadfd < 0)
197+
if (!xlogexists)
196198
elog(WARNING, "WAL segment \"%s\" is absent", xlogfpath);
197-
else
199+
else if (xlogreadfd != -1)
198200
elog(WARNING, "error was occured during reading WAL segment \"%s\"",
199201
xlogfpath);
200202
}
@@ -232,6 +234,7 @@ validate_wal(pgBackup *backup,
232234
{
233235
close(xlogreadfd);
234236
xlogreadfd = -1;
237+
xlogexists = false;
235238
}
236239
}
237240

@@ -256,6 +259,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
256259
{
257260
close(xlogreadfd);
258261
xlogreadfd = -1;
262+
xlogexists = false;
259263
}
260264

261265
XLByteToSeg(targetPagePtr, xlogreadsegno);
@@ -272,11 +276,12 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
272276
{
273277
elog(LOG, "opening WAL segment \"%s\"", xlogfpath);
274278

279+
xlogexists = true;
275280
xlogreadfd = open(xlogfpath, O_RDONLY | PG_BINARY, 0);
276281

277282
if (xlogreadfd < 0)
278283
{
279-
elog(INFO, "could not open WAL segment \"%s\": %s",
284+
elog(WARNING, "could not open WAL segment \"%s\": %s",
280285
xlogfpath, strerror(errno));
281286
return -1;
282287
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy