1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-02 11:44:50 +03:00

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
This commit is contained in:
Simon Riggs 2012-08-08 21:28:41 +01:00
parent 4bf70f2229
commit df09dbbcaa

View File

@ -2809,6 +2809,11 @@ XLogFileRead(uint32 log, uint32 seg, int emode, TimeLineID tli,
errmsg("could not rename file \"%s\" to \"%s\": %m", errmsg("could not rename file \"%s\" to \"%s\": %m",
path, xlogfpath))); 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 * If the existing segment was replaced, since walsenders might have
* it open, request them to reload a currently-open segment. * it open, request them to reload a currently-open segment.