pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
To: Олег Самойлов <splarv@ya.ru>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: BUG? Slave don't reconnect to the master
Date: Tue, 29 Sep 2020 16:16:27 +0200
Message-ID: <20200929161627.5dfd2f04@firost> (raw)
In-Reply-To: <32B9ED9C-0603-47D8-9C5D-0A2461E42971@ya.ru>
References: <60590EC6-4062-4F25-A49C-3948ED2A7D47@ya.ru>
	<20200819150713.326c3532@firost>
	<52BADD0F-E348-43BB-8992-FDE86F3B1A65@ya.ru>
	<20200821162642.4245add6@firost>
	<253962B4-CB29-4A90-A995-17B6047D3876@ya.ru>
	<20200903133915.1850e955@firost>
	<8323CF21-D316-4529-BFC3-77C97F8E341B@ya.ru>
	<20200909171931.64fce7bb@firost>
	<2045A2B7-E972-44EF-B1D3-B86618FC9780@ya.ru>
	<20200929113100.70b57e60@firost>
	<32B9ED9C-0603-47D8-9C5D-0A2461E42971@ya.ru>

On Tue, 29 Sep 2020 16:22:18 +0300
Олег Самойлов <splarv@ya.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,





view thread (8+ messages)  latest in thread

Message-ID: <20200929161627.5dfd2f04@firost>
Permalink:  ../20200929161627.5dfd2f04@firost/
Also on:    postgresql.org/message-id/20200929161627.5dfd2f04@firost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jgdr@dalibo.com, splarv@ya.ru
  Subject: Re: BUG? Slave don't reconnect to the master
  In-Reply-To: <20200929161627.5dfd2f04@firost>
  References: <60590EC6-4062-4F25-A49C-3948ED2A7D47@ya.ru> <20200819150713.326c3532@firost> <52BADD0F-E348-43BB-8992-FDE86F3B1A65@ya.ru> <20200821162642.4245add6@firost> <253962B4-CB29-4A90-A995-17B6047D3876@ya.ru> <20200903133915.1850e955@firost> <8323CF21-D316-4529-BFC3-77C97F8E341B@ya.ru> <20200909171931.64fce7bb@firost> <2045A2B7-E972-44EF-B1D3-B86618FC9780@ya.ru> <20200929113100.70b57e60@firost> <32B9ED9C-0603-47D8-9C5D-0A2461E42971@ya.ru> <20200929161627.5dfd2f04@firost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox