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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: At promotion, archive last segment from old timeline with .parti
Date: 2015-05-22 12:15:50
Message-ID: CAHGQGwFxxAR30xjAUd4n6YfqQwMdjZhN8iaBJr7Fqg_noEfEaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, May 22, 2015 at 6:59 PM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
> On 05/22/2015 12:35 PM, Fujii Masao wrote:
>>
>> 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?
>
>
> PITR to a specific location always requires manual intervention by the DBA
> anyway. It's not something you'd automate. Copying the .partial file
> manually into pg_xlog is just one small extra step.

We should document this? Otherwise no DBA can complete such PITR scenario.

Also as a safeguard, if the required WAL file is not found but the file with
.parital suffix found during recovery, maybe we should cause the recovery to
fail at that moment. Otherwise since the required file is not found, the server
would end the recovery before the .partial file and start normal processing.
DBA may not be able to notice this incompletion of the recovery.
Maybe this is overkill against the small use case, though.

> Even if there are some downsides to this, I think it's just plain evil to
> archive a partial segment that looks indistinguishable from a complete one.
> We have had reports of that causing confusion in production systems. What if
> the master had already archived the complete version of the segment before
> dying? The standby will try to archive a partial version of the same, which
> will fail, or worse, overwrite the complete version with the partial one.
>
> Note that PITR in that scenario was always hit-and-miss. First of all, if
> the master died, there is no guarantee that it archived all the previous
> segments successfully before dying. (archive_mode=always alleviates that in
> 9.5, as the standby will archive them even if the master didn't).

So we don't need to rename the last WAL file basically in archive recovery
case even if it's read from pg_xlog, i.e., it's partial. No?

Regards,

--
Fujii Masao

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2015-05-22 12:42:55 pgsql: Minor enhancement of readability of ALTER TABLE syntax in the do
Previous Message Heikki Linnakangas 2015-05-22 09:59:44 Re: [COMMITTERS] pgsql: At promotion, archive last segment from old timeline with .parti

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-05-22 12:20:07 Re: Missing "-i / --ignore-version" in pg_dump help
Previous Message Fabrízio de Royes Mello 2015-05-22 11:59:30 Missing "-i / --ignore-version" in pg_dump help