From: Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Virendra Kumar <viru_7683@yahoo.com>
Cc: Pgsql-general General <pgsql-general@postgresql.org>
Subject: Re: Back Port Request for INVALID Startup Packet
Date: Thu, 12 Mar 2020 13:16:45 +0000
Message-ID: <3aba09f2-6892-570e-1499-609898657719@ocado.com> (raw)
In-Reply-To: <10013.1583972967@sss.pgh.pa.us>
References: <1580001356.490624.1583970710532.ref@mail.yahoo.com>
<1580001356.490624.1583970710532@mail.yahoo.com>
<10013.1583972967@sss.pgh.pa.us>
On 12/03/2020 00:29, Tom Lane wrote:
> Virendra Kumar <viru_7683@yahoo.com> writes:
>> Can you please back port patch where if a 0 byte packet sent to PG instance (Health Checks), it starts complaining about invalid startup packet and flood the log which increases log size considerably if the health checks are every 3 seconds or something like that.
>> Patch Requested - https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=342cb650e
>
> We generally don't like to change behavior of back branches without
> ironclad agreement that the existing behavior is a bug ... which this
> surely isn't. Also, the discussion leading up to that patch specifically
> considered and rejected back-patching; so I'm disinclined to overrule
> that decision now.
>
> I would suggest that an every-three-second health check is not
> appropriate, especially one that is so minimal that it only
> detects whether the postmaster is alive.
Does the backend explicitly configure the kernel's TCP accept queue?
Unless Postgres sets it to impractically low numbers, the above test
sounds weak from yet another angle; the postmaster might be "alive" as a
process but completely seized for other reasons: at least in Linux the
TCP accept queue progresses the 3-way handshake so long as the bound
socket's file descriptor is still held, without even waiting for accept().
I'd recommend a better probe that at least sends a startup message and
expects the backend to follow up with the authentication request (no
need to craft messages manually, testing for more abstract
messages/states out of psql or some libpq wrapper would do). Better
still, if credentials/access are available, run a query.
--
Notice:
This email is confidential and may contain copyright material of
members of the Ocado Group. Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the members of the
Ocado Group.
If you are not the intended recipient, please notify us
immediately and delete all copies of this message. Please note that it is
your responsibility to scan this message for viruses.
References to the
"Ocado Group" are to Ocado Group plc (registered in England and Wales with
number 7098618) and its subsidiary undertakings (as that expression is
defined in the Companies Act 2006) from time to time. The registered office
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way,
Hatfield, Hertfordshire, AL10 9UL.
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: f.venchiarutti@ocado.com, tgl@sss.pgh.pa.us, viru_7683@yahoo.com
Subject: Re: Back Port Request for INVALID Startup Packet
In-Reply-To: <3aba09f2-6892-570e-1499-609898657719@ocado.com>
References: <1580001356.490624.1583970710532.ref@mail.yahoo.com> <1580001356.490624.1583970710532@mail.yahoo.com> <10013.1583972967@sss.pgh.pa.us> <3aba09f2-6892-570e-1499-609898657719@ocado.com>
* 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