Re: shared-memory based stats collector - v70

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>, Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Melanie Plageman <melanieplageman(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: shared-memory based stats collector - v70
Date: 2024-12-04 15:24:55
Message-ID: Z1B0R7TLMVsZlONS@ip-10-97-1-34.eu-west-3.compute.internal
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Dec 04, 2024 at 04:00:53AM +0300, Anton A. Melnikov wrote:
>
> On 03.12.2024 18:07, Andres Freund wrote:
> > Hi,
> >
> > On 2024-12-03 13:37:48 +0300, Anton A. Melnikov wrote:
> > > 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?
> >
> > It's code that should be unreachable. But in case it is encountered in a
> > production scenario, it's not worth taking down the server for it.
>
> Thanks! It's clear.
> Although there is a test case that lead to this assertion to be triggered.
> But i doubt if anything needs to be fixed.
> I described this case in as it seems to me suitable thread:
> https://www.postgresql.org/message-id/56bf8ff9-dd8c-47b2-872a-748ede82af99%40postgrespro.ru

Thanks! I've the feeling that something has to be fixed, see my comments in
[1]. It might be that the failed assertion does not handle a "valid" scenario.

[1]: https://www.postgresql.org/message-id/Z1BzI/eMTCOKA%2Bj6%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2024-12-04 15:57:11 Re: Replace current implementations in crypt() and gen_salt() to OpenSSL
Previous Message Bertrand Drouvot 2024-12-04 15:20:03 Re: Missing LWLock protection in pgstat_reset_replslot()