Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKuv7-00BXNE-AZ for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Dec 2024 07:44:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tKuv4-000UK6-ID for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Dec 2024 07:44:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKuv4-000UJy-3V for pgsql-hackers@lists.postgresql.org; Tue, 10 Dec 2024 07:44:35 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKuv1-00221w-Mz for pgsql-hackers@lists.postgresql.org; Tue, 10 Dec 2024 07:44:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1733816670; bh=xRQKd0SlDJQcmup/sP/EaIFtppWio6k8/dZnsjNHoEA=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=MQTgojYymPp5uRANiltCw8IWNv+9r01Q1AAmcsVMoC58o4/KK0Trb+iJI3K1/E8EE 2LgidEgKNEIQpJ5C+sn3u17hpdnD06XOMLvSJn3hgkJRtoZG3p55ywhi50Qq4O2cbJ q0F1JNrRxfwnKKaFVE8EnJREs1aIrAn/ozk9YWjU96lbsJhocD0qc2Sl0uc7nhMtHA s3Y+zb46SrCMsnsGTvQ15z2I7AcHfWeTtOSZ2eknU1b0wH2BMEw+TTRAILhtuNO558 rOU1ja7iJDA1+swwdXsTwYOxEwEw1xjG/Yo22In0LUhO7wtDnoNPcTI5cgipxhja5X y0O6sxbFn82zA== Received: from [172.30.48.58] (unknown [172.30.48.58]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.melnikov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 2E9E860AB4; Tue, 10 Dec 2024 10:44:30 +0300 (MSK) Content-Type: multipart/mixed; boundary="------------KI9cK9IPjHPGLordmGKZ6c0c" Message-ID: <0ba6d37a-af09-4024-bbca-2dde0b0e3fa1@postgrespro.ru> Date: Tue, 10 Dec 2024 10:44:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: shared-memory based stats collector - v70 To: Bertrand Drouvot , Michael Paquier Cc: Andres Freund , "Drouvot, Bertrand" , Greg Stark , Tom Lane , Melanie Plageman , Kyotaro Horiguchi , Justin Pryzby , Thomas Munro , "David G. Johnston" , PostgreSQL Hackers References: <5911c537-5665-4e93-91fa-de5465df487d@postgrespro.ru> Content-Language: en-US From: "Anton A. Melnikov" In-Reply-To: X-KSMG-AntiPhishing: NotDetected, bases: 2024/12/10 05:59:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/12/10 06:08:00 #26955431 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------KI9cK9IPjHPGLordmGKZ6c0c Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi! On 09.12.2024 11:03, Bertrand Drouvot wrote: > There is a missing space. I think that should be " at server..." or "...%llu ". Thanks for pointing this out. In the other code the elog messages are all on one line, regardless of their length. Did the same in v3. On 10.12.2024 09:42, Bertrand Drouvot wrote: > On Tue, Dec 10, 2024 at 09:54:36AM +0900, Michael Paquier wrote: >> On Mon, Dec 09, 2024 at 08:03:54AM +0000, Bertrand Drouvot wrote: >>> Right. OTOH I think that could help the tap test added in da99fedf8c to not >>> rely on assert enabled build (the tap test could "simply" check for the >>> WARNING in the logfile instead). >> >> That's true. Still, the coverage that we have is also enough for >> assert builds, which is what the test is going to run with most of the >> time anyway. > > Yeah, that's fine by me and don't see the added value of the WARNING then. Agreed that this WARNING has no additional value for testing purposes at pgfarm or ci. Assert is better. My logic was different. It's clear that during normal server operation this code should be unreachable. But we admit that in production deployments it can be executed in case of some bug that is still unknown to us. Now it is done in such a way that in this case the server simply skip it and won't notice about it. And no one will know that this happened. But if there is a warning here, the information will remain in the server logs, we can find out about it and we can try to reproduce similar behavior in the testing environment and probably detect a hidden bug like in [1]. Thanks a lot for fixing this! With the best regards, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company [1] https://www.postgresql.org/message-id/56bf8ff9-dd8c-47b2-872a-748ede82af99%40postgrespro.ru --------------KI9cK9IPjHPGLordmGKZ6c0c Content-Type: text/x-patch; charset=UTF-8; name="v3-0002-Add-warning-about-dropped-stat-entries.patch" Content-Disposition: attachment; filename="v3-0002-Add-warning-about-dropped-stat-entries.patch" Content-Transfer-Encoding: base64 RnJvbSAzZmY5NTViYTc2NzRjNzhhMTYyYTNjMDI0M2IyOGM1MDA0NzY4ZTA3IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiAiQW50b24gQS4gTWVsbmlrb3YiIDxhLm1lbG5pa292 QHBvc3RncmVzcHJvLnJ1PgpEYXRlOiBTYXQsIDcgRGVjIDIwMjQgMTI6MDA6MTAgKzAzMDAK U3ViamVjdDogW1BBVENIXSBBZGQgd2Fybmlu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