Re: Urgent :: Postgresql streaming replication issue - sync mode

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: Urgent :: Postgresql streaming replication issue - sync mode
Дата
Msg-id 570b37b59153953b39ac7b279d17095458c055d2.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: Urgent :: Postgresql streaming replication issue - sync mode  (Jason Wang <jasonwang.public@gmail.com>)
Список pgsql-general
On Fri, 2019-10-04 at 00:34 +1000, Jason Wang wrote:
> I read this 
> https://www.2ndquadrant.com/en/blog/evolution-fault-tolerance-postgresql-synchronous-commit/
> 
> But don't see why your primary would have more records than the
> standby? 
> 
> If killall was issued before commit returned, that means the
> transaction wasn't completed so yes you would lose records after last
> commit but that's expected; if commit was returned both primary and
> standby should have the transaction.
> 
> Are you sure in your case you end up with primary and standby with
> different records from a single transaction?

PostgreSQL synchronous streaming replicatoin doesn't use anything like
two-phase commit.

1. It commits the transaction locally first, which generates WAL.
2. The WAL gets replicated.
3. As soon as the standby reports success, COMMIT returns.

If there is a failure after the first step completed, the
transaction will be committed locally, but not on the standby.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




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

Предыдущее
От: Jason Wang
Дата:
Сообщение: Re: Urgent :: Postgresql streaming replication issue - sync mode
Следующее
От: bhargav kamineni
Дата:
Сообщение: Re: PMChildFlags array