Skip to content

Commit 8143a56

Browse files
Fix minor bug in XLogFileRead() that accidentally worked.
Cascading replication copied the incoming file into pg_xlog but didn't set path correctly, so the first attempt to open file failed causing it to loop around and look for file in pg_xlog. So the earlier coding worked, but accidentally rather than by design. Spotted by Fujii Masao, fix by Fujii Masao and Simon Riggs
1 parent 21786db commit 8143a56

File tree

1 file changed

+5
-0
lines changed
  • src/backend/access/transam

1 file changed

+5
-0
lines changed

src/backend/access/transam/xlog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,6 +2805,11 @@ XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
28052805
errmsg("could not rename file \"%s\" to \"%s\": %m",
28062806
path, xlogfpath)));
28072807

2808+
/*
2809+
* Set path to point at the new file in pg_xlog.
2810+
*/
2811+
strncpy(path, xlogfpath, MAXPGPATH);
2812+
28082813
/*
28092814
* If the existing segment was replaced, since walsenders might have
28102815
* it open, request them to reload a currently-open segment.

0 commit comments

Comments
 (0)