Re: exitArchiveRecovery woes

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: exitArchiveRecovery woes
Дата
Msg-id CA+TgmoYez=y0BHLu-xVtoWC-5-g19oFDMqFTcBnRxJ4j4qt=-g@mail.gmail.com
обсуждение исходный текст
Ответ на exitArchiveRecovery woes  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Ответы Re: exitArchiveRecovery woes  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
On Wed, Dec 17, 2014 at 8:40 AM, Heikki Linnakangas
<hlinnakangas@vmware.com> wrote:
> At the end of archive recovery, we copy the last segment from the old
> timeline, to initialize the first segment on the new timeline. For example,
> if the timeline switch happens in the middle of WAL segment
> 000000010000000000000005, the whole 000000010000000000000005 segment is
> copied to become 000000020000000000000005. The copying is necessary, so that
> the new segment contains valid data up to the switch point.
>
> However, we wouldn't really need to copy the whole segment, copying up to
> the switch point would be enough. In fact, copying the whole segment is a
> bad idea, because the copied WAL looks valid on the new timeline too.

Your proposed change makes sense to me, but why do we need the segment
to contain valid data up to the switch point?  It seems like the
switch between timelines should be "crisper": replay WAL on the old
timeline only from the old segment, and from the new timeline only on
the new segment.  Anything else seems like an invitation to unending
corner-case bugs.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Table-level log_autovacuum_min_duration
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Proposal: Log inability to lock pages during vacuum