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

Commit2103430

Browse files
committed
Fix parsing of xlog file name in pg_receivexlog.
The parsing of WAL filenames of segments larger than > 255 was broken,making pg_receivexlog unable to restart streaming after stopping it.The bug was introduced by the changes in 9.3 to represent WAL segment numberas a 64-bit integer instead of two ints, log and seg. To fix, replace theplain sscanf call with XLogFromFileName macro, which does the conversionfrom log+seg to a 64-bit integer correcly.Reported by Mika Eloranta.
1 parente36ce0c commit2103430

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

‎src/bin/pg_basebackup/pg_receivexlog.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ FindStreamingStart(uint32 *tli)
134134
while ((dirent=readdir(dir))!=NULL)
135135
{
136136
uint32tli;
137-
unsignedintlog,
138-
seg;
139137
XLogSegNosegno;
140138
boolispartial;
141139

@@ -164,14 +162,7 @@ FindStreamingStart(uint32 *tli)
164162
/*
165163
* Looks like an xlog file. Parse its position.
166164
*/
167-
if (sscanf(dirent->d_name,"%08X%08X%08X",&tli,&log,&seg)!=3)
168-
{
169-
fprintf(stderr,
170-
_("%s: could not parse transaction log file name \"%s\"\n"),
171-
progname,dirent->d_name);
172-
disconnect_and_exit(1);
173-
}
174-
segno= ((uint64)log) <<32 |seg;
165+
XLogFromFileName(dirent->d_name,&tli,&segno);
175166

176167
/*
177168
* Check that the segment has the right size, if it's supposed to be

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp