Postgres Synchronous replication

Поиск
Список
Период
Сортировка
От Ravi Krishna
Тема Postgres Synchronous replication
Дата
Msg-id CACER=P2-th_mciMaLDPu1eNge13fDmCHhjcrk-3MLc=ANJ_RzA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Postgres Synchronous replication
Список pgsql-admin
I want to understand how PG sync replication works. This is what I know (assuming two node sync replication)

1 - Application issues commit.
2 - PG commits the transaction locally on the primary server.
3 - At this stage the application has not got the commit indication back.
4 - PG transmits the transaction from the local to the remote server.
5 - Remote server sends back acknowledgement 
6 - The app gets commit ack back.

So this means, between step 2 and step 6, the app is not aware that the transaction has already been committed.
This is the reason why, in the event of server crashing between step 2 and step 6, and the remote takes over as the
new primary, the crashed server can not restart as standby and the only option is to recreate the db from the remote
server (which is now acting as the primary).

Am I correct in the understanding?

One more question: In Step 5, does the remote harden the transaction on the disk, or merely receives the transaction in the log buffer and it sends back ACK to the local server.

Thanks

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

Предыдущее
От: Thomas SIMON
Дата:
Сообщение: Re: Performances issues with SSD volume ?
Следующее
От: Payal Singh
Дата:
Сообщение: Re: Postgres Synchronous replication