Re: Issue with pg_stat_subscription_stats

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Melanie Plageman <melanieplageman(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issue with pg_stat_subscription_stats
Date: 2022-03-15 04:04:16
Message-ID: CAA4eK1LEXgf6Y_Yxu=4=61kCwThtMp_KsOVt+Vo8VDHUZfaShw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 13, 2022 at 1:45 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> On 2022-03-12 08:28:35 +0530, Amit Kapila wrote:
> > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman
> > <melanieplageman(at)gmail(dot)com> wrote:
> > >
> > > So, I noticed that pg_stat_reset_subscription_stats() wasn't working
> > > properly, and, upon further investigation, I'm not sure the view
> > > pg_stat_subscription_stats is being properly populated.
> > >
> >
> > I have tried the below scenario based on this:
> > Step:1 Create some data that generates conflicts and lead to apply
> > failures and then check in the view:
>
> I think the problem is present when there was *no* conflict
> previously. Because nothing populates the stats entry without an error, the
> reset doesn't have anything to set the stats_reset field in, which then means
> that the stats_reset field is NULL even though stats have been reset.
>
> I'll just repeat what I've said before: Making variable numbered stats
> individiually resettable is a bad idea.
>

IIUC correctly, we are doing this via
pg_stat_reset_single_table_counters(),
pg_stat_reset_single_function_counters(),
pg_stat_reset_replication_slot(), pg_stat_reset_subscription_stats().
So, if we want to do something in this regrard then it is probably
better to do for all.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message kuroda.hayato@fujitsu.com 2022-03-15 04:25:21 RE: Handle infinite recursion in logical replication setup
Previous Message Thomas Munro 2022-03-15 02:55:56 Re: pg_tablespace_location() failure with allow_in_place_tablespaces