aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-08-08 21:28:41 +0100
committerSimon Riggs <simon@2ndQuadrant.com>2012-08-08 21:28:41 +0100
commitdf09dbbcaa546350a78ce9f096b872fa3a28cafb (patch)
treed39c8bfbb7fc8f693b9f3a5c733632347e10ef48 /src
parent4bf70f22296596a1b67eac92aa6a5fc367b37cb3 (diff)
downloadpostgresql-df09dbbcaa546350a78ce9f096b872fa3a28cafb.tar.gz
postgresql-df09dbbcaa546350a78ce9f096b872fa3a28cafb.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 37c0eda510a..7b9b483ed97 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -2810,6 +2810,11 @@ XLogFileRead(uint32 log, uint32 seg, 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.
*/