Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfaa97de

Browse files
author
Artur Zakirov
committed
Fix error messaging during reading WAL segments
1 parentde2a0d1 commitfaa97de

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

‎parsexlog.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ extractPageMap(const char *archivedir, XLogRecPtr startpoint, TimeLineID tli,
8383
errormsg);
8484
else
8585
elog(ERROR,"could not read WAL record at %X/%X",
86-
(uint32) (startpoint >>32),
87-
(uint32) (startpoint));
86+
(uint32) (errptr >>32),
87+
(uint32) (errptr));
8888
}
8989

9090
extractPageInfo(xlogreader);
@@ -139,17 +139,13 @@ validate_wal(pgBackup *backup,
139139
}
140140

141141
if (errormsg)
142-
elog(ERROR,"stop check WALs becausecould not read WAL record at %X/%X: %s\nend time:%s end xid:"XID_FMT,
142+
elog(ERROR,"could not read WAL record at %X/%X: %s",
143143
(uint32) (errptr >>32), (uint32) (errptr),
144-
errormsg,
145-
timestamp,
146-
last_xid);
144+
errormsg);
147145
else
148-
elog(ERROR,"could not read WAL record at %X/%X\nend time:%s end xid:"XID_FMT,
146+
elog(ERROR,"could not read WAL record at %X/%X",
149147
(uint32) (errptr >>32),
150-
(uint32) (errptr),
151-
timestamp,
152-
last_xid);
148+
(uint32) (errptr));
153149
}
154150

155151
timestamp_record=getRecordTimestamp(xlogreader,&last_time);
@@ -214,15 +210,19 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,
214210
XLogFileName(xlogfname,private->tli,xlogreadsegno);
215211
snprintf(xlogfpath,MAXPGPATH,"%s/%s",private->archivedir,
216212
xlogfname);
217-
elog(LOG,"opening WAL segment \"%s\"",xlogfpath);
218-
219-
xlogreadfd=open(xlogfpath,O_RDONLY |PG_BINARY,0);
220213

221-
if (xlogreadfd<0)
214+
if (fileExists(xlogfpath))
222215
{
223-
elog(INFO,"could not open WAL segment \"%s\": %s",
224-
xlogfpath,strerror(errno));
225-
return-1;
216+
elog(LOG,"opening WAL segment \"%s\"",xlogfpath);
217+
218+
xlogreadfd=open(xlogfpath,O_RDONLY |PG_BINARY,0);
219+
220+
if (xlogreadfd<0)
221+
{
222+
elog(INFO,"could not open WAL segment \"%s\": %s",
223+
xlogfpath,strerror(errno));
224+
return-1;
225+
}
226226
}
227227
}
228228

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp