RE: Collect statistics about conflicts in logical replication

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Subject: RE: Collect statistics about conflicts in logical replication
Date: 2024-08-29 05:36:40
Message-ID: OS3PR01MB57180170DECF65EA8721ED7B94962@OS3PR01MB5718.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thursday, August 29, 2024 11:18 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> On Thu, Aug 29, 2024 at 4:59 AM Peter Smith <smithpb2250(at)gmail(dot)com>
> wrote:
> >
> > On Wed, Aug 28, 2024 at 9:19 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
> wrote:
> > >
> > > On Wed, Aug 28, 2024 at 11:43 AM shveta malik
> <shveta(dot)malik(at)gmail(dot)com> wrote:
> > > >
> > > > Thanks for the patch. Just thinking out loud, since we have names
> > > > like 'apply_error_count', 'sync_error_count' which tells that they
> > > > are actually error-count, will it be better to have something
> > > > similar in conflict-count cases, like
> > > > 'insert_exists_conflict_count', 'delete_missing_conflict_count' and so
> on. Thoughts?
> > > >
> > >
> > > It would be better to have conflict in the names but OTOH it will
> > > make the names a bit longer. The other alternatives could be (a)
> > > insert_exists_confl_count, etc. (b) confl_insert_exists_count, etc.
> > > (c) confl_insert_exists, etc. These are based on the column names in
> > > the existing view pg_stat_database_conflicts [1]. The (c) looks
> > > better than other options but it will make the conflict-related
> > > columns different from error-related columns.
> > >
> > > Yet another option is to have a different view like
> > > pg_stat_subscription_conflicts but that sounds like going too far.
>
> Yes, I think we are good with pg_stat_subscription_stats for the time being.
>
> > >
> > > [1] -
> > >
> https://www.postgresql.org/docs/devel/monitoring-stats.html#MONITORI
> > > NG-PG-STAT-DATABASE-CONFLICTS-VIEW
> >
> > Option (c) looked good to me.
>
> +1 for option c. it should be okay to not have '_count' in the name.

Agreed. Here is new version patch which change the names as suggested. I also
rebased the patch based on another renaming commit 640178c9.

Best Regards,
Hou zj

Attachment Content-Type Size
v4-0001-Collect-statistics-about-conflicts-in-logical-rep.patch application/octet-stream 25.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-08-29 05:41:36 Re: 039_end_of_wal: error in "xl_tot_len zero" test
Previous Message Yuya Watari 2024-08-29 05:34:46 Re: [PoC] Reducing planning time when tables have many partitions