Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jCNhu-0001l3-BP for pgsql-general@arkaria.postgresql.org; Thu, 12 Mar 2020 13:17:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jCNhq-00034a-UU for pgsql-general@arkaria.postgresql.org; Thu, 12 Mar 2020 13:16:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jCNhq-00034T-IN for pgsql-general@lists.postgresql.org; Thu, 12 Mar 2020 13:16:58 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jCNhj-0006fs-1g for pgsql-general@postgresql.org; Thu, 12 Mar 2020 13:16:57 +0000 Received: by mail-wm1-x343.google.com with SMTP id r7so5505663wmg.0 for ; Thu, 12 Mar 2020 06:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ocado.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lmwRlTFtnLeUxnhnZr7WnY1u+fNNWSHpBVvY0n7GDhY=; b=aK1VnEl9totlSLQ4LF25QBnYtn2FVdgpyhCJKzk2fcO0/yFZ3LQIIGhcqkrMtfAgpS UU8qdQbXE5EZSkoipgoRkOin1qrQB6j6k6jzWnRzeDRNzj7ePxkA4n9bS++VKLe0ssNz zqjcT/S5NlbyifII4tfDoAAee288HQqt5GvCsR84byhO3yPjlTq88jr4/pRahJjG3eyq MMs4yOqQQHwJm8XjDtV8hsU8HtZr9wMfyER7mDlVQqi1fNSNcFKeFSQ+j2XH+lMDba1p li2Lfc9u7NKsgNR5eGKPomtT56eJePerx98EGWU+T9D5UVxh8wBKb35ExR3x1vBfb1cy 7U2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=lmwRlTFtnLeUxnhnZr7WnY1u+fNNWSHpBVvY0n7GDhY=; b=Xsxu3PTLHp51mSjwv1PxinTvyHs6e1f7I4UEROwNEO6W+Gv90tIGeY6ufhU6lxfkzy pi31UuZe72iU5nyB+JYnnrMFTXqDRnpeV+RHaYgeoCHjkOvfwE2ZWR76a1bPl1UX4I3F YECfmvnDfW4m8bI5Qr7lEptQqnGxjfQEzTaNwoZfue/J9Ygy2uDAReaY6XaH2bwsWJQm PO/LcGQBxd7GzMX/VkXklBwWng8TUpWXPVWraHaTxYYgvLLNERSWVKIimNqZbfFeCvNa tiBECd1x8QkL21qsPY/JWSORnP/4GAS+wxq5PjKSGmkxhb1EkUn4Ml9qESGWLaBHvcZU jtdQ== X-Gm-Message-State: ANhLgQ2ALhsfhiY44Jy20627JLA2mGHTyvNP91d5Uso5nSKAb+OVGSGh EgD4ago6ZjqZI17sxrAol9MVTXb+0URF+W5aBNde6UmKxQHGPQq57Q8bjv51w4hrvmrCMBLWLga CT1lEn9OC6n4PQz+l/IWULQVUAg6m0d3v3FHLeSLqodhnQcrFSH8vDjlvq5XdACajSGcUxWuMJd lHgwd2 X-Google-Smtp-Source: ADFU+vuk2DhSDqfFBTHf2fmj4+AELAkQVWQj7s6FyBHYf6RYtAMAzO5FwTG3ySxoDtAP1ir9DOwh4w== X-Received: by 2002:a7b:cb12:: with SMTP id u18mr4904131wmj.153.1584019006654; Thu, 12 Mar 2020 06:16:46 -0700 (PDT) Received: from [10.62.12.18] ([91.206.1.124]) by smtp.gmail.com with ESMTPSA id w22sm12680786wmk.34.2020.03.12.06.16.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Mar 2020 06:16:46 -0700 (PDT) Reply-To: f.venchiarutti@ocado.com Subject: Re: Back Port Request for INVALID Startup Packet To: Tom Lane , Virendra Kumar Cc: Pgsql-general General References: <1580001356.490624.1583970710532.ref@mail.yahoo.com> <1580001356.490624.1583970710532@mail.yahoo.com> <10013.1583972967@sss.pgh.pa.us> From: Fabio Ugo Venchiarutti Organization: Ocado Technology Message-ID: <3aba09f2-6892-570e-1499-609898657719@ocado.com> Date: Thu, 12 Mar 2020 13:16:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <10013.1583972967@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/03/2020 00:29, Tom Lane wrote: > Virendra Kumar writes: >> Can you please back port patch where if a 0 byte packet sent to PG insta= nce (Health Checks), it starts complaining about invalid startup packet and= flood the log which increases log size considerably if the health checks a= re every 3 seconds or something like that. >> Patch Requested - https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;= a=3Dpatch;h=3D342cb650e >=20 > 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. >=20 > 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=20 sounds weak from yet another angle; the postmaster might be "alive" as a=20 process but completely seized for other reasons: at least in Linux the=20 TCP accept queue progresses the 3-way handshake so long as the bound=20 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=20 expects the backend to follow up with the authentication request (no=20 need to craft messages manually, testing for more abstract=20 messages/states out of psql or some libpq wrapper would do). Better=20 still, if credentials/access are available, run a query. --=20 Notice:=20 This email is confidential and may contain copyright material of=20 members of the Ocado Group. Opinions and views expressed in this message=20 may not necessarily reflect the opinions and views of the members of the=20 Ocado Group. If you are not the intended recipient, please notify us=20 immediately and delete all copies of this message. Please note that it is= =20 your responsibility to scan this message for viruses. References to the=20 "Ocado Group" are to Ocado Group plc (registered in England and Wales with= =20 number 7098618) and its subsidiary undertakings (as that expression is=20 defined in the Companies Act 2006) from time to time. The registered office= =20 of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way,=20 Hatfield, Hertfordshire, AL10 9UL.