Re: Timeline in the light of Synchronous replication

Поиск
Список
Период
Сортировка
Искать
От
Dimitri Fontaine
Тема
Re: Timeline in the light of Synchronous replication
Дата
Msg-id
m2r5fnx4i1.fsf@2ndQuadrant.fr
Ответ на
Список
Дерево обсуждения
Timeline in the light of Synchronous replication fazool mein <fazoolmein@gmail.com>
Re: Timeline in the light of Synchronous replication David Fetter <david@fetter.org>
Re: Timeline in the light of Synchronous replication Fujii Masao <masao.fujii@gmail.com>
Re: Timeline in the light of Synchronous replication Robert Haas <robertmhaas@gmail.com>
Re: Timeline in the light of Synchronous replication Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Re: Timeline in the light of Synchronous replication fazool mein <fazoolmein@gmail.com>
Fujii Masao  writes:
> But, even though we will have done that, it should be noted that WAL in
> A might be ahead of that in B. For example, A might crash right after
> writing WAL to the disk and before sending it to B. So when we restart
> the old master A as the standby after failover, we should need to delete
> some WAL files (in A) which are inconsistent with the WAL sequence in B.

The idea to send from master to slave the current last applied LSN has
been talked about already. It would allow to send the WAL content in
parallel of it's local fsync() on the master, the standby would refrain
from applying any WAL segment until it knows the master is past that.

Now, given such a behavior, that would mean that when A joins again as a
standby, it would have to ask B for the current last applied LSN too,
and would notice the timeline change. Maybe by adding a facility to
request the last LSN of the previous timeline, and with the behavior
above applied there (skipping now-known-future-WALs in recovery), that
would work automatically?

There's still the problem of WALs that have been applied before
recovery, I don't know that we can do anything here. But maybe we could
also tweak the CHECKPOINT mecanism not to advance the restart point
until we know the standbys have already replayed anything up to the
restart point?

-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

В списке pgsql-hackers по дате отправления
От: Fujii Masao
Дата:
От: KaiGai Kohei
Дата:
Сообщение: Re: leaky views, yet again
FAQ