From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: At promotion, don't leave behind a partial segment on the old ti
Date: Fri, 22 May 2015 08:06:18 +0000
Message-ID: <E1YvhyE-0006YZ-Kd@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
At promotion, don't leave behind a partial segment on the old timeline.
With commit de768844, a copy of the partial segment was archived with the
.partial suffix, but the original file was still left in pg_xlog, so it
didn't actually solve the problems with archiving the partial segment that
it was supposed to solve. With this patch, the partial segment is renamed
rather than copied, so we only archive it with the .partial suffix.
Also be more robust in detecting if the last segment is already being
archived. Previously I used XLogArchiveIsBusy() for that, but that's not
quite right. With archive_mode='always', there might be a .ready file for
it, and we don't want to rename it to .partial in that case.
The old segment is needed until we're fully committed to the new timeline,
i.e. until we've written the end-of-recovery WAL record and updated the
min recovery point and timeline in the control file. So move the renaming
later in the startup sequence, after all that's been done.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/7cbee7c0a1db668c60c020a3fd1e3234daa562a9
Modified Files
--------------
src/backend/access/transam/xlog.c | 138 ++++++++++++++++++------------
src/backend/access/transam/xlogarchive.c | 35 ++++++++
src/include/access/xlog_internal.h | 1 +
3 files changed, 120 insertions(+), 54 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: At promotion, don't leave behind a partial segment on the old ti
In-Reply-To: <E1YvhyE-0006YZ-Kd@gemulon.postgresql.org>
References: <E1YvhyE-0006YZ-Kd@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox