What would happen if a recycled segment gets assigned a newer timeline than the one we are currently recovering from? In the reported erroneous behavior, that is what happens causing XLogFileReadAnyTLI() to return such bogus segment causing the error. Since, expectedTLIs contains a newer timeline at its head, and if such a wrongly recycled (that is one bearing a newer timeline than curFileTLI) segment exists in pg_xlog, XLogFileReadAnyTLI() would return fd of that segment itself causing the error in question. In next retry, the same thing would happen and prevent standby startup from proceeding any further.
So, should we also look at the segment recycling code to see how it names the recycled segments (what timelineID does it use) ? For example, in CreateRestartPoint() where segments are recycled? -- View this message in context: http://postgresql.1045698.n5.nabble.com/Failing-start-up-archive-recovery-at-Standby-mode-in-PG9-2-4-tp5753110p5753358.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers