Re: Issue with pg_stat_subscription_stats

2022-10-06 Thread Michael Paquier
On Thu, Oct 06, 2022 at 04:43:43PM -0700, Andres Freund wrote: > Thanks for bringing this thread up, I'd lost track of it. The merit goes to Sawada-san here, who has poked me about this thread :p -- Michael signature.asc Description: PGP signature

Re: Issue with pg_stat_subscription_stats

2022-10-06 Thread Masahiko Sawada
On Fri, Oct 7, 2022 at 9:27 AM Andres Freund wrote: > > On 2022-10-06 16:43:43 -0700, Andres Freund wrote: > > On 2022-10-06 14:10:56 +0900, Michael Paquier wrote: > > > On Tue, Jul 12, 2022 at 09:31:16AM +0530, Amit Kapila wrote: > > > > I am not against backpatching this but OTOH it doesn't appe

Re: Issue with pg_stat_subscription_stats

2022-10-06 Thread Andres Freund
On 2022-10-06 16:43:43 -0700, Andres Freund wrote: > On 2022-10-06 14:10:56 +0900, Michael Paquier wrote: > > On Tue, Jul 12, 2022 at 09:31:16AM +0530, Amit Kapila wrote: > > > I am not against backpatching this but OTOH it doesn't appear critical > > > enough to block one's work, so not backpatchi

Re: Issue with pg_stat_subscription_stats

2022-10-06 Thread Andres Freund
Hi, On 2022-10-06 14:10:56 +0900, Michael Paquier wrote: > On Tue, Jul 12, 2022 at 09:31:16AM +0530, Amit Kapila wrote: > > I am not against backpatching this but OTOH it doesn't appear critical > > enough to block one's work, so not backpatching should be fine. > > We are just talking about the

Re: Issue with pg_stat_subscription_stats

2022-10-05 Thread Michael Paquier
On Tue, Jul 12, 2022 at 09:31:16AM +0530, Amit Kapila wrote: > I am not against backpatching this but OTOH it doesn't appear critical > enough to block one's work, so not backpatching should be fine. We are just talking about the reset timestamp not being set at when the object is created, right?

Re: Issue with pg_stat_subscription_stats

2022-07-11 Thread Amit Kapila
On Tue, Jul 12, 2022 at 3:26 AM Andres Freund wrote: > > On 2022-07-07 10:50:27 +0900, Masahiko Sawada wrote: > > Right, it's more robust. I've updated the patch accordingly. > > Do others have thoughts about backpatching this to 15 or not? > I am not against backpatching this but OTOH it doesn't

Re: Issue with pg_stat_subscription_stats

2022-07-11 Thread Andres Freund
On 2022-07-07 10:50:27 +0900, Masahiko Sawada wrote: > Right, it's more robust. I've updated the patch accordingly. Do others have thoughts about backpatching this to 15 or not?

Re: Issue with pg_stat_subscription_stats

2022-07-06 Thread Masahiko Sawada
On Thu, Jul 7, 2022 at 1:28 AM Andres Freund wrote: > > On 2022-07-05 14:52:45 -0700, Andres Freund wrote: > > On 2022-07-04 11:01:01 +0900, Masahiko Sawada wrote: > > > I've attached the patch, fix_drop_subscriptions_stats.patch, to fix it. > > > > LGTM. Unless somebody sees a reason not to, I'm

Re: Issue with pg_stat_subscription_stats

2022-07-06 Thread Masahiko Sawada
On Thu, Jul 7, 2022 at 12:53 AM Andres Freund wrote: > > Hi, > > On 2022-07-06 11:41:46 +0900, Masahiko Sawada wrote: > > diff --git a/src/test/regress/sql/subscription.sql > > b/src/test/regress/sql/subscription.sql > > index 74c38ead5d..6a46956f6e 100644 > > --- a/src/test/regress/sql/subscript

Re: Issue with pg_stat_subscription_stats

2022-07-06 Thread Andres Freund
On 2022-07-05 14:52:45 -0700, Andres Freund wrote: > On 2022-07-04 11:01:01 +0900, Masahiko Sawada wrote: > > I've attached the patch, fix_drop_subscriptions_stats.patch, to fix it. > > LGTM. Unless somebody sees a reason not to, I'm planning to commit that to 15 > and HEAD. Pushed.

Re: Issue with pg_stat_subscription_stats

2022-07-06 Thread Andres Freund
Hi, On 2022-07-06 11:41:46 +0900, Masahiko Sawada wrote: > diff --git a/src/test/regress/sql/subscription.sql > b/src/test/regress/sql/subscription.sql > index 74c38ead5d..6a46956f6e 100644 > --- a/src/test/regress/sql/subscription.sql > +++ b/src/test/regress/sql/subscription.sql > @@ -30,6 +30,

Re: Issue with pg_stat_subscription_stats

2022-07-05 Thread Masahiko Sawada
On Wed, Jul 6, 2022 at 10:48 AM Andres Freund wrote: > > On 2022-07-06 10:25:02 +0900, Masahiko Sawada wrote: > > > I think most of this could just be pgstat_reset_entry(). > > > > I think pgstat_reset_entry() doesn't work for this case as it skips > > resetting the entry if it doesn't exist. > >

Re: Issue with pg_stat_subscription_stats

2022-07-05 Thread Andres Freund
On 2022-07-06 10:25:02 +0900, Masahiko Sawada wrote: > > I think most of this could just be pgstat_reset_entry(). > > I think pgstat_reset_entry() doesn't work for this case as it skips > resetting the entry if it doesn't exist. True - but a pgstat_get_entry_ref(create = true); pgstat_reset_entry

Re: Issue with pg_stat_subscription_stats

2022-07-05 Thread Masahiko Sawada
On Wed, Jul 6, 2022 at 6:52 AM Andres Freund wrote: > > Hi, > > On 2022-07-04 11:01:01 +0900, Masahiko Sawada wrote: > > I've attached the patch, fix_drop_subscriptions_stats.patch, to fix it. > > LGTM. Unless somebody sees a reason not to, I'm planning to commit that to 15 > and HEAD. > > > > I'v

Re: Issue with pg_stat_subscription_stats

2022-07-05 Thread Andres Freund
Hi, On 2022-07-04 11:01:01 +0900, Masahiko Sawada wrote: > I've attached the patch, fix_drop_subscriptions_stats.patch, to fix it. LGTM. Unless somebody sees a reason not to, I'm planning to commit that to 15 and HEAD. > I've also attached another PoC patch, > poc_create_subscription_stats.patc

Re: Issue with pg_stat_subscription_stats

2022-07-03 Thread Masahiko Sawada
On Sat, Jul 2, 2022 at 9:52 AM Masahiko Sawada wrote: > > > > On Sat, Jul 2, 2022 at 2:53 Andres Freund wrote: >> >> Hi, >> >> On 2022-07-01 16:08:48 +0900, Masahiko Sawada wrote: >> > Yes, my point is that it may be misleading that the subscription stats >> > are created when a subscription is c

Re: Issue with pg_stat_subscription_stats

2022-07-01 Thread Masahiko Sawada
On Sat, Jul 2, 2022 at 2:53 Andres Freund wrote: > Hi, > > On 2022-07-01 16:08:48 +0900, Masahiko Sawada wrote: > > Yes, my point is that it may be misleading that the subscription stats > > are created when a subscription is created. > > I think it's important to create stats at that time, becau

Re: Issue with pg_stat_subscription_stats

2022-07-01 Thread Andres Freund
Hi, On 2022-07-01 16:08:48 +0900, Masahiko Sawada wrote: > Yes, my point is that it may be misleading that the subscription stats > are created when a subscription is created. I think it's important to create stats at that time, because otherwise it's basically impossible to ensure that stats are

Re: Issue with pg_stat_subscription_stats

2022-07-01 Thread Andres Freund
Hi, On 2022-07-01 10:41:55 +0900, Masahiko Sawada wrote: > While looking at this issue again, I realized there seems to be two > problems with subscription stats on shmem stats: > > Firstly, we call pgstat_create_subscription() when creating a > subscription but the subscription stats are reported

Re: Issue with pg_stat_subscription_stats

2022-07-01 Thread Masahiko Sawada
On Fri, Jul 1, 2022 at 3:01 PM Amit Kapila wrote: > > On Fri, Jul 1, 2022 at 7:12 AM Masahiko Sawada wrote: > > > > On Wed, Mar 16, 2022 at 11:34 PM Masahiko Sawada > > wrote: > > > > > > > While looking at this issue again, I realized there seems to be two > > problems with subscription stats

Re: Issue with pg_stat_subscription_stats

2022-06-30 Thread Amit Kapila
On Fri, Jul 1, 2022 at 7:12 AM Masahiko Sawada wrote: > > On Wed, Mar 16, 2022 at 11:34 PM Masahiko Sawada > wrote: > > > > While looking at this issue again, I realized there seems to be two > problems with subscription stats on shmem stats: > > Firstly, we call pgstat_create_subscription() whe

Re: Issue with pg_stat_subscription_stats

2022-06-30 Thread Masahiko Sawada
Hi, On Wed, Mar 16, 2022 at 11:34 PM Masahiko Sawada wrote: > > On Wed, Mar 16, 2022 at 8:51 PM Amit Kapila wrote: > > > > On Tue, Mar 15, 2022 at 10:09 AM Masahiko Sawada > > wrote: > > > > > > On Tue, Mar 15, 2022 at 3:34 AM Melanie Plageman > > > wrote: > > > > > > > > On Mon, Mar 14, 20

Re: Issue with pg_stat_subscription_stats

2022-03-16 Thread Masahiko Sawada
On Wed, Mar 16, 2022 at 8:51 PM Amit Kapila wrote: > > On Tue, Mar 15, 2022 at 10:09 AM Masahiko Sawada > wrote: > > > > On Tue, Mar 15, 2022 at 3:34 AM Melanie Plageman > > wrote: > > > > > > On Mon, Mar 14, 2022 at 4:02 AM Masahiko Sawada > > > wrote: > > > > > > > > On Mon, Mar 14, 2022 at

Re: Issue with pg_stat_subscription_stats

2022-03-16 Thread Amit Kapila
On Tue, Mar 15, 2022 at 10:09 AM Masahiko Sawada wrote: > > On Tue, Mar 15, 2022 at 3:34 AM Melanie Plageman > wrote: > > > > On Mon, Mar 14, 2022 at 4:02 AM Masahiko Sawada > > wrote: > > > > > > On Mon, Mar 14, 2022 at 2:05 AM Melanie Plageman > > > wrote: > > > > > > > > On Sat, Mar 12, 202

Re: Issue with pg_stat_subscription_stats

2022-03-14 Thread Masahiko Sawada
On Tue, Mar 15, 2022 at 3:34 AM Melanie Plageman wrote: > > On Mon, Mar 14, 2022 at 4:02 AM Masahiko Sawada wrote: > > > > On Mon, Mar 14, 2022 at 2:05 AM Melanie Plageman > > wrote: > > > > > > On Sat, Mar 12, 2022 at 3:15 PM Andres Freund wrote: > > > > > > > > Hi, > > > > > > > > On 2022-03-

Re: Issue with pg_stat_subscription_stats

2022-03-14 Thread Amit Kapila
On Sun, Mar 13, 2022 at 1:45 AM Andres Freund wrote: > > On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman > > wrote: > > > > > > So, I noticed that pg_stat_reset_subscription_stats() wasn't working > > > properly, and, upon further investigatio

Re: Issue with pg_stat_subscription_stats

2022-03-14 Thread Melanie Plageman
On Mon, Mar 14, 2022 at 4:02 AM Masahiko Sawada wrote: > > On Mon, Mar 14, 2022 at 2:05 AM Melanie Plageman > wrote: > > > > On Sat, Mar 12, 2022 at 3:15 PM Andres Freund wrote: > > > > > > Hi, > > > > > > On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > > > > On Sat, Mar 12, 2022 at 2:14 AM M

Re: Issue with pg_stat_subscription_stats

2022-03-14 Thread Masahiko Sawada
On Mon, Mar 14, 2022 at 2:05 AM Melanie Plageman wrote: > > On Sat, Mar 12, 2022 at 3:15 PM Andres Freund wrote: > > > > Hi, > > > > On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > > > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman > > > wrote: > > > > > > > > So, I noticed that pg_stat_res

Re: Issue with pg_stat_subscription_stats

2022-03-13 Thread Melanie Plageman
On Sat, Mar 12, 2022 at 3:15 PM Andres Freund wrote: > > Hi, > > On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman > > wrote: > > > > > > So, I noticed that pg_stat_reset_subscription_stats() wasn't working > > > properly, and, upon further inve

Re: Issue with pg_stat_subscription_stats

2022-03-12 Thread Andres Freund
Hi, On 2022-03-12 08:28:35 +0530, Amit Kapila wrote: > On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman > 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 bein

Re: Issue with pg_stat_subscription_stats

2022-03-11 Thread Amit Kapila
On Sat, Mar 12, 2022 at 2:14 AM Melanie Plageman 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

Issue with pg_stat_subscription_stats

2022-03-11 Thread Melanie Plageman
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 don't think subscriptionStatHash will be created properly and that the reset timestamp won't be initialize