Commit 8143a568 authored by Simon Riggs's avatar Simon Riggs

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
parent 21786db8
......@@ -2805,6 +2805,11 @@ XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
errmsg("could not rename file \"%s\" to \"%s\": %m",
path, xlogfpath)));
/*
* Set path to point at the new file in pg_xlog.
*/
strncpy(path, xlogfpath, MAXPGPATH);
/*
* If the existing segment was replaced, since walsenders might have
* it open, request them to reload a currently-open segment.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment