From: Heikki Linnakangas Date: Wed, 2 Jan 2013 12:35:15 +0000 (+0200) Subject: Fix bug in streaming replication over multiple tli switches. X-Git-Tag: REL9_3_BETA1~543 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d194d7a52630d855f43edbf0129e131099af6c14;p=postgresql Fix bug in streaming replication over multiple tli switches. After receiving some WAL over streaming replication, try to open the file from the timeline we're currently recieving, not recoveryTargetTLI. They are usually the same, which is why wasn't noticed before, but you'd get an error if there have been more than one timeline switch between the current point in WAL and the recovery target. --- diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index b43412d605..c847913183 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -9745,7 +9745,7 @@ WaitForWALToBecomeAvailable(XLogRecPtr RecPtr, bool randAccess, if (readFile < 0) { readFile = XLogFileRead(readSegNo, PANIC, - recoveryTargetTLI, + receiveTLI, XLOG_FROM_STREAM, false); Assert(readFile >= 0); }