Re: how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?
Дата
Msg-id CAMsr+YE1Oc7axX=KqSUGn=wQp4gs=VLxO4WFk1YJP4E2X8yomA@mail.gmail.com
обсуждение исходный текст
Ответ на how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?  (Rui Hai Jiang <ruihaij@gmail.com>)
Ответы Re: how is the WAL receiver process stopped and restarted when the network connection is broken and then restored?  (Rui Hai Jiang <ruihaij@gmail.com>)
Список pgsql-hackers
On 22 June 2016 at 23:52, Rui Hai Jiang <ruihaij@gmail.com> wrote:
Hello,

I have one Primary server and one Standby server. They are doing streaming replication well.

I  did some testing. I broke the network connection between them for a few minutes, and then restored the network. I found the both the WAL sender and WAL receiver were stopped and the restarted.

I wonder how WAL receiver process is stopped and restarted. I have checked the code hoping to find out the answer, but I don't have any clue. 

If TCP keepalives are enabled, the TCP connection will break when the keepalives stop arriving.

If wal receiver timeout is enabled, it'll notice that it didn't get any data from the walsender and assume it went away.

If the OS notices that the socket went away - say, it got a TCP RST from the remote peer as it shut down cleanly - it'll close the walreceiver socket and the walreceiver will quit.

Otherwise it won't notice and will wait indefinitely.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype