Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Melih Mutlu <m(dot)melihmutlu(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases
Date: 2023-06-19 03:37:46
Message-ID: CAA4eK1JdUb_whr-WMmcpB58hYHRM-FoEP7qQ_HK06_9qdTYSHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 19, 2023 at 6:50 AM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> On Sat, Jun 17, 2023 at 6:45 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Tue, May 16, 2023 at 8:00 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > >
> > > On Thu, May 11, 2023 at 5:12 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
> > > >
> > >
> > > After thinking more about it, I realized that this is not a problem
> > > specific to HEAD. ISTM the problem is that by commit 7b64e4b3, we drop
> > > the stats entry of subscription that is not associated with a
> > > replication slot for apply worker, but we missed the case where the
> > > subscription is not associated with both replication slots for apply
> > > and tablesync. So IIUC we should backpatch it down to 15.
> > >
> >
> > I agree that it should be backpatched to 15.
> >
> > > Since in pg15, since we don't create the subscription stats at CREATE
> > > SUBSCRIPTION time but do when the first error is reported,
> > >
> >
> > AFAICS, the call to pgstat_create_subscription() is present in
> > CreateSubscription() in 15 as well, so, I don't get your point.
>
> IIUC in 15, pgstat_create_subscription() doesn't create the stats
> entry. See commit e0b01429590.
>

Thanks for the clarification. Your changes looks good to me though I
haven't tested it.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-06-19 03:39:27 Re: Support logical replication of DDLs
Previous Message Tom Lane 2023-06-19 02:57:37 Re: path->param_info only set for lateral?