Re: Sending unflushed WAL in physical replication

Поиск
Список
Период
Сортировка
От Rahila Syed
Тема Re: Sending unflushed WAL in physical replication
Дата
Msg-id CAH2L28usoyAnwS5y51ukuaXdrp2WDZGMXFbTVXMFTJmOZxv=FA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Sending unflushed WAL in physical replication  (Aleksander Alekseev <aleksander@tigerdata.com>)
Ответы Re: Sending unflushed WAL in physical replication
Список pgsql-hackers
Hi,

 
> Please find attached a POC patch that introduces changes to the WAL sender and
> receiver, allowing WAL records to be sent to standbys before they are flushed
> to disk on the primary during physical replication. [..]

I didn't look at the code but your description of the design sounds OK.

 
Thanks for looking into it.
 
I wanted to clarify: what happens if master doesn't increase flushPtr
and replica runs out of memory for WAL records?

This is a great question. I'm currently working on implementing a solution for this.
One possible solution is to write the records to a spill file when the flush pointer
indicates that none have been flushed on the primary. Once they have been flushed
on the primary, the records can then be copied from the spill file to the WAL segments.
While this method may lead to increased I/O, if such spills are infrequent, the overall
performance impact should be minimal.

Another option would be to notify the sender that there is no more space available
and to pause sending additional data until records are flushed on the sender side.
However, this approach could reintroduce some of the replication lag or network
latency that we are aiming to minimize.  

Kindly let me know your views.

Thank you,
Rahila Syed

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