Re: pgsql: At promotion, archive last segment from old timeline with .parti

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: At promotion, archive last segment from old timeline with .parti
Date: 2015-05-22 09:35:17
Message-ID: CAHGQGwGNGrd5r18xAtVMhHa6YCyzfhyZxrDK2NJORgR3CUqT-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Sat, May 9, 2015 at 4:07 AM, Heikki Linnakangas
<heikki(dot)linnakangas(at)iki(dot)fi> wrote:
> At promotion, archive last segment from old timeline with .partial suffix.
>
> Previously, we would archive the possible-incomplete WAL segment with its
> normal filename, but that causes trouble if the server owning that timeline
> is still running, and tries to archive the same segment later. It's not nice
> for the standby to trip up the master's archival like that. And it's pretty
> confusing, anyway, to have an incomplete segment in the archive that's
> indistinguishable from a normal, complete segment.
>
> To avoid such confusion, add a .partial suffix to the file. Or to be more
> precise, make a copy of the old segment under the .partial suffix, and
> archive that instead of the original file. pg_receivexlog also uses the
> .partial suffix for the same purpose, to tell apart incompletely streamed
> files from complete ones.
>
> There is no automatic mechanism to use the .partial files at recovery, so
> they will go unused, unless the administrator manually copies to them to
> the pg_xlog directory (and removes the .partial suffix). Recovery won't
> normally need the WAL - when recovering to the new timeline, it will find
> the same WAL on the first segment on the new timeline instead - but it
> nevertheless feels better to archive the file with the .partial suffix, for
> debugging purposes if nothing else.

Doesn't this change break the case where we want to PITR to the recovery
target location in the last partial WAL file with the old timeline?
In this case, that partial WAL file needs to be read and replayed. But
since the suffix of its filename is .partial, unless DBA gets rid of the suffix,
the WAL file cannot be restored and PITR would fail. No?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-05-22 09:59:44 Re: [COMMITTERS] pgsql: At promotion, archive last segment from old timeline with .parti
Previous Message Heikki Linnakangas 2015-05-22 08:06:18 pgsql: At promotion, don't leave behind a partial segment on the old ti

Browse pgsql-hackers by date

  From Date Subject
Next Message Shigeru Hanada 2015-05-22 09:37:58 Re: postgres_fdw join pushdown (was Re: Custom/Foreign-Join-APIs)
Previous Message Fujii Masao 2015-05-22 09:14:14 Re: Add a hint when postgresql.conf hot_standby = 'off' and recovery.conf standby = 'on'