aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-08-08 21:25:23 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2012-08-08 21:25:23 +0100
commit8143a56854a4f46968b12badb5b008f448e08ef5 (patch)
tree6ef3a53d351e96f9fed6bd192329e00cfc41f900 /src
parent21786db81fca3fca0a17da3f58cc6590615e1580 (diff)
downloadpostgresql-8143a56854a4f46968b12badb5b008f448e08ef5.tar.gz
postgresql-8143a56854a4f46968b12badb5b008f448e08ef5.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/xlog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index efd0347bc9b..efda4634d56 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2806,6 +2806,11 @@ XLogFileRead(XLogSegNo segno, int emode, TimeLineID tli,
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.
*/