Re: streaming replication breaks horribly if master crashes

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: streaming replication breaks horribly if master crashes
Дата
Msg-id AANLkTimZ-Qlql4JiftSpPzcvcqoM1qtKlaFGcRbOG7cq@mail.gmail.com
обсуждение исходный текст
Ответ на Re: streaming replication breaks horribly if master crashes  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
On Wed, Jun 16, 2010 at 4:00 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Robert Haas <robertmhaas@gmail.com> wrote:
>> So, obviously at this point my slave database is corrupted beyond
>> repair due to nothing more than an unexpected crash on the master.
>
> Certainly that's true for resuming replication.  From your
> description it sounds as though the slave would be usable for
> purposes of taking over for an unrecoverable master.  Or am I
> misunderstanding?

It depends on what you mean.  If you can prevent the slave from ever
reconnecting to the master, then it's still safe to promote it.  But
if the master comes up and starts generating WAL again, and the slave
ever sees any of that WAL (either via SR or via the archive) then
you're toast.

In my case, the slave was irrecoverably out of sync with the master as
soon as the crash happened, but it still could have been promoted at
that point if you killed the old master.  It became corrupted as soon
as it replayed the first WAL record starting beyond 1/87000000.  At
that point it's potentially got arbitrary corruption; you need a new
base backup (but this may not be immediately obvious; it may look OK
even if it isn't).

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


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: streaming replication breaks horribly if master crashes
Следующее
От: Robert Haas
Дата:
Сообщение: Re: streaming replication breaks horribly if master crashes