Re: Assertion failure on PG15 with modified test_shm_mq test

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pavan(dot)deolasee(at)gmail(dot)com
Cc: andres(at)anarazel(dot)de, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Assertion failure on PG15 with modified test_shm_mq test
Date: 2022-08-24 04:05:00
Message-ID: 20220824.130500.2262022953686351752.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 18 Aug 2022 16:58:24 +0530, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> wrote in
> Hi,
>
> On Thu, Aug 18, 2022 at 5:38 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> > We can't move pgstat shutdown into on_dsm callback because that's too late
> > to
> > allocate *new* dsm segments, which we might need to do while flushing
> > out pending stats.
> >
> > See
> > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fa91d4c91f28f4819dc54f93adbd413a685e366a
> > for a way to avoid the problem.
> >
> >
> Thanks for the hint. I will try that approach. I wonder though if there is
> something more we can do. For example, would it make sense to throw a
> WARNING and avoid segfault if pgstat machinery is already shutdown? Just
> worried if the code can be reached from multiple paths and testing all of
> those would be difficult for extension developers, especially given this
> may happen in error recovery path.

I'm not sure how extensions can face this problem, but..

pgstat is designed not to lose reported numbers. The assertion is
manifets that intention. It is not enabled on non-assertion builds
and pgstat enters undefined state then maybe crash after the assertion
point. On the other hand I don't think we want to perform the same
check for the all places the assertion exists on non-assertion builds.

We cannot simply replace the assertion with ereport().

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-08-24 04:06:01 Re: [PATCH] Expose port->authn_id to extensions and triggers
Previous Message Andres Freund 2022-08-24 04:01:18 Re: ecpg assertion on windows