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

pgsql: Request XLOG switch before writing checkpoint in

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Request XLOG switch before writing checkpoint in
Date: 2009-05-07 11:25:25
Message-ID: 20090507112525.7D2A875331D@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Request XLOG switch before writing checkpoint in pg_start_backup(). Otherwise
you can end up with an unrecoverable backup if you start a new base backup
right after finishing archive recovery. In that scenario, the redo pointer of
the checkpoint that pg_start_backup() writes points to the XLOG segment where
the timeline-changing end-of-archive-recovery checkpoint is. The beginning
of that segment contains pages with the old timeline ID, and we don't accept
that in recovery unless we find a history file covering the old timeline ID.
If you omit pg_xlog from the base backup and clear the archive directory
before starting the backup, there will be no such history file available.

The bug is present in all versions since PITR was introduced in 8.0, but I'm
back-patching only back to 8.2. Earlier versions didn't have XLOG switch
records, making this fix unfeasible. Given the lack of reports until now,
it doesn't seem worthwhile to spend more effort to fix 8.0 and 8.1.

Per report and suggestion by Mikael Krantz

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xlog.c (r1.336 -> r1.337)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.336&r2=1.337)

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2009-05-07 11:25:29
Subject: pgsql: Request XLOG switch before writing checkpoint in
Previous:From: User ItagakiDate: 2009-05-07 09:04:29
Subject: textsearch-ja - textsearch_senna: Implements restrict selectivity

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