Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df09dbb

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 4bf70f2 commit df09dbb

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
@@ -2809,6 +2809,11 @@ XLogFileRead(uint32 log, uint32 seg, int emode, TimeLineID tli,
28092809
errmsg("could not rename file \"%s\" to \"%s\": %m",
28102810
path, xlogfpath)));
28112811

2812+
/*
2813+
* Set path to point at the new file in pg_xlog.
2814+
*/
2815+
strncpy(path, xlogfpath, MAXPGPATH);
2816+
28122817
/*
28132818
* If the existing segment was replaced, since walsenders might have
28142819
* it open, request them to reload a currently-open segment.

0 commit comments

Comments
 (0)