Re: pg_stat_get_replication_slot() marked not strict, crashes - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: pg_stat_get_replication_slot() marked not strict, crashes
Date
Msg-id CAA4eK1+Ormrg+xEj5=cfCXP0jcpF8eEPGPo+ZB=WNVe5amac=w@mail.gmail.com
Whole thread Raw
In response to Re: pg_stat_get_replication_slot() marked not strict, crashes  (vignesh C <vignesh21@gmail.com>)
Responses Re: pg_stat_get_replication_slot() marked not strict, crashes  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sun, Mar 27, 2022 at 11:59 AM vignesh C <vignesh21@gmail.com> wrote:
>
> On Sun, Mar 27, 2022 at 2:54 AM Andres Freund <andres@anarazel.de> wrote:
> >
> > Hi,
> >
> > I'm working to increase the test coverage of pgstat related stuff higher (for
> > the shared memory stats patch, of course).
> >
> > "Accidentally" noticed that
> >   SELECT * FROM pg_stat_get_replication_slot(NULL);
> > crashes.  This is present in HEAD and 14.
> >
> > I guess we'll have to add a code-level check in 14 to deal with this?
>
> This problem is reproducible in both PG14 & Head, changing isstrict
> solves the problem. In PG14 should we also add a check in
> pg_stat_get_replication_slot so that it can solve the problem for the
> existing users who have already installed PG14 or will this be handled
> automatically when upgrading to the new version.
>

I am not sure if for 14 we can make a catalog change as that would
require catversion bump, so adding a code-level check as suggested by
Andres seems like a better option. Andres/Tom, any better ideas for
this?

Thanks for the patch but for HEAD, we also need handling and test for
pg_stat_get_subscription_stats. Considering this for HEAD, we can mark
both pg_stat_get_replication_slot and pg_stat_get_subscription_stats
as strict and in 14, we need to add a code-level check for
pg_stat_get_replication_slot.

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors
Next
From: Japin Li
Date:
Subject: Fix pg_waldump documentation about block option