Re: Report bytes and transactions actually sent downtream

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Report bytes and transactions actually sent downtream
Date: 2025-10-06 05:02:57
Message-ID: CAExHW5tk4LqJSGgNHrUeXv=4m91NHmSaoaBpDR8Nx+qw=uG_6A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 3, 2025 at 7:17 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Fri, Oct 03, 2025 at 12:22:05PM +0530, Ashutosh Bapat wrote:
> > Here's patchset addressing two issues:
>
> Thanks for the patch update!
>
> > I
> > have added a note in documentation for plugin authors, warning them
> > that this isn't expected.
>
> What note are you referring to? (I'm failing to see it).

Patch 0002, changes in logicaldecoding.sgml. I am a bit hesitant to
add more details as to what "misleading" means since mentioning so
might be seen as a documented behaviour and thus plugin authors
relying on it.

>
> > I don't think it's worth adding complexity
> > in code to support such a case unless we see a practical need for the
> > same.
>
> Sounds good.
>
>
> > Issue 2: Once X + 2 is loaded, further statistics are accumulated on
> > the top of statistics accumulated by version X. Attached patch fixes
> > issue 2 by zero'ing out the stats when the plugin does not report the
> > statistics.
>
> +#define REPLSLOT_SET_TO_ZERO(fld) statent->fld = 0
>
> It looks like that the associated "undef" is missing.

Good catch. Fixed.

--
Best Wishes,
Ashutosh Bapat

Attachment Content-Type Size
0001-Report-output-plugin-statistics-in-pg_stat_-20251006.patch text/x-patch 49.9 KB
0002-Address-review-comments-from-Bertrand-20251006.patch text/x-patch 5.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-10-06 05:20:52 Re: Add memory_limit_hits to pg_stat_replication_slots
Previous Message shveta malik 2025-10-06 04:52:09 Re: Improve pg_sync_replication_slots() to wait for primary to advance