Skip site navigation (1) Skip section navigation (2)

pgsql: Avoid bogus "out-of-sequence timeline ID" errors instandby-mode

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid bogus "out-of-sequence timeline ID" errors instandby-mode
Date: 2012-11-22 16:20:41
Message-ID: E1TbZW5-0000ph-U1@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Avoid bogus "out-of-sequence timeline ID" errors in standby-mode.

When startup process opens a WAL segment after replaying part of it, it
validates the first page on the WAL segment, even though the page it's
really interested in later in the file. As part of the validation, it checks
that the TLI on the page header is >= the TLI it saw on the last page it
read. If the segment contains a timeline switch, and we have already
replayed it, and then re-open the WAL segment (because of streaming
replication got disconnected and reconnected, for example), the TLI check
will fail when the first page is validated. Fix that by relaxing the TLI
check when re-opening a WAL segment.

Backpatch to 9.0. Earlier versions had the same code, but before standby
mode was introduced in 9.0, recovery never tried to re-read a segment after
partially replaying it.

Reported by Amit Kapila, while testing a new feature.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/875d3f3039f09ba74f442ceb95411e3a75f18048

Modified Files
--------------
src/backend/access/transam/xlog.c |   32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2012-11-22 16:25:24
Subject: pgsql: Fix pg_resetxlog to use correct path to postmaster.pid.
Previous:From: Tom LaneDate: 2012-11-21 20:19:44
Subject: pgsql: Don't launch new child processes after we've been told to shutd

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group