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 1tIQI2-00EEls-DJ for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 10:37:59 +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 1tIQHz-0098XT-QC for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 10:37:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQHz-0098XK-9x for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 10:37:56 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tIQHw-000oI5-KI for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 10:37:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1733222269; bh=fTb1eMiVX0gBg52mil1W71xluiUpFnhVIKCHmDofSAE=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=fClBhQicKetnaZV9ZcSpf9M1f69yRV3Nj3uJxuvBNB37ZUVqXOBzu3FmfhUOoIg2B oOUaLWMJX+363dLYxF+1SMNQWTrQKagvsuZlNJeuaziy2EKg0zm8NEKtT+XFh+VJ1z nkR60wRaPHqC6pNvibjeNRkxzxdYp3bLRnB7M1EIxaCQMk2zN8w9qry4SYWhH8OxUD hhkZ4c8Dgh+hPw3+X41xeU5Ot9IfKeIdvF7f+4WqeWXIMHCLwMeMFgbreI8zVWI+sF qrD1kPzE8PS66IsW7oVcWjrOy0H7aftTVKClyqoK21m+WioVk7Ftq5dlAL5dkb/ujZ JYNDQCda85mqw== Received: from [172.30.40.66] (unknown [213.171.56.12]) (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 7417D5FFD8; Tue, 3 Dec 2024 13:37:49 +0300 (MSK) Message-ID: Date: Tue, 3 Dec 2024 13:37:48 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: shared-memory based stats collector - v70 To: "Drouvot, Bertrand" , Andres Freund , Greg Stark Cc: Tom Lane , Melanie Plageman , Kyotaro Horiguchi , Justin Pryzby , Thomas Munro , "David G. Johnston" , PostgreSQL Hackers References: <5db2b670-f3df-57ea-bdc6-962a582ff2e4@amazon.com> <0befffb3-8323-f2cd-915f-0ab64396f500@amazon.com> <1c56f4c6-61ce-d131-553c-297326e20bf1@amazon.com> <7f622949-2d78-c030-e7e0-cdee5f6cf79b@amazon.com> <20220818195124.c7ipzf6c5v7vxymc@awork3.anarazel.de> <5bfcf1a5-4224-9324-594b-725e704c95b1@amazon.com> Content-Language: en-US From: "Anton A. Melnikov" In-Reply-To: <5bfcf1a5-4224-9324-594b-725e704c95b1@amazon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected, bases: 2024/12/03 09:55: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/03 00:44:00 #26930054 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 Hi! Found a place in the code of this patch that is unclear to me: https://github.com/postgres/postgres/blob/1acf10549e64c6a52ced570d712fcba1a2f5d1ec/src/backend/utils/activity/pgstat.c#L1658 Owing assert() the next if() should never be performed, but the comment above says the opposite. Is this assert really needed here? And if so, for what? Would be glad for clarification. With the best regards, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company