]> granicus.if.org Git - postgresql/commitdiff
Fix bug in streaming replication over multiple tli switches.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 2 Jan 2013 12:35:15 +0000 (14:35 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 2 Jan 2013 12:35:15 +0000 (14:35 +0200)
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.

src/backend/access/transam/xlog.c

index b43412d605a8856d53c001139ed0344c1a12a28e..c847913183c7180013c3f09ae0495dd301f96c9d 100644 (file)
@@ -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);
                                        }