Re: [BUG] Archive recovery failure on 9.3+.

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>, Josh Berkus <josh(at)agliodbs(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUG] Archive recovery failure on 9.3+.
Date: 2014-02-13 14:15:24
Message-ID: 52FCD37C.3070806@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/13/2014 04:07 PM, Christoph Berg wrote:
> Re: Heikki Linnakangas 2014-02-13 <52FCD02C(dot)3060201(at)vmware(dot)com>
>>> Is removing the "test ! -f" part and hence overwriting files in the
>>> archive safe, i.e. are the files the same?
>>
>> No. Not in general, anyway. If the old master keeps running, even
>> for a moment, after the partial file was copied, it will have
>> created more WAL records which are present in the old master's copy
>> of the segment, but not in the standby's.
>
> So why does PostgreSQL then ever try to archive something from the old
> timeline? Isn't overwriting files on the old timeline just a very bad
> idea in general?

Yes.

> If so, it shouldn't be the responsibility of
> archive_command to prevent this, but the server shouldn't be trying
> that in the first place.

Totally agreed. That's why I'm proposing that we stop doing that :-).

It's been a bad idea from day one, but I'm a bit hesitent to back-patch
until someone actually complains. There has been subtle changes to
archive recovery behavior in each release, so I'm worried that the old
behavior was in fact useful to someone in some corner case that we're
missing.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2014-02-13 14:22:41 Re: Terminating pg_basebackup background streamer
Previous Message digoal 2014-02-13 14:07:59 BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding