Re: BUG? Slave don't reconnect to the master

From: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
To: Олег Самойлов <splarv(at)ya(dot)ru>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: BUG? Slave don't reconnect to the master
Date: 2020-09-29 14:16:27
Message-ID: 20200929161627.5dfd2f04@firost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 29 Sep 2020 16:22:18 +0300
Олег Самойлов <splarv(at)ya(dot)ru> wrote:
[...]
> > In regards with keepalive parameters, I am a bit surprised. According to the
> > source code, parameters defaults are:
> >
> > keepalives=1
> > keepalives_idle=1
> > keepalives_interval=1
> > keepalives_count=1
> >
> > But I just had a quick look there, so I probably miss something.

I did miss something. See bellow.

> According to the official documentation, if keepalive parameters are not
> specified, then used default value from the OS.
> https://www.postgresql.org/docs/12/runtime-config-connection.html#RUNTIME-CONFIG-CONNECTION-SETTINGS

This settings are related to the server side.

The one you are setting in primary_conninfo are related to the client side:

https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS

> Cite: A value of 0 (the default) selects the operating system's default.
>
> I don't know what is the default values for the CentOS 7.

sysctl -ar net.ipv4.tcp_keepalive_

> I can only assert that adding keepalive is solved issue with Postgres-STOP
> test and looked like problems with ForkBomb too. And keep in mind, I still
> use PostgreSQL 11. May be 12 or 13 something changed.

Sorry, there was some misunderstanding of the source code on my side. The
"keepalives" parameter is enabled by default on client side, but if you don't
set keepalives_idle, keepalives_interval and keepalives_count, they fallback to
system default ones which are 7200, 75 and 9 (on Debian and CentOS). So more
than 2 hours.

Regards,

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2020-09-29 14:48:23 Re: BUG? Slave don't reconnect to the master
Previous Message Олег Самойлов 2020-09-29 13:22:18 Re: BUG? Slave don't reconnect to the master