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
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.