Re: Report bytes and transactions actually sent downtream - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Report bytes and transactions actually sent downtream
Date
Msg-id aUJs5w787EjKlBfv@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Report bytes and transactions actually sent downtream  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
Hi,

On Thu, Dec 11, 2025 at 10:29:42AM +0530, Ashutosh Bapat wrote:
> Sorry for the delayed response. PFA the patch implementing the idea
> discussed above. It relies on the output plugin callback to return
> correct boolean but maintains the statistics in the core itself.

Thanks for the new patch version!

What worries me is all those API changes:

-typedef void (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx,
+typedef bool (*LogicalDecodeChangeCB) (struct LogicalDecodingContext *ctx,

Those changes will break existing third party logical decoding plugin, even ones
that don't want the new statistics features.

What about not changing those and just add a single new optional callback, say?

typedef void (*LogicalDecodeReportStatsCB)(
    LogicalDecodingContext *ctx,
    ReorderBufferTXN *txn,
    bool *transaction_sent,
    size_t *bytes_filtered
);

This way:

- Existing plugins can still work without modification
- New or existing plugins can choose to provide statistics

Thoughts?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Anthonin Bonnefoy
Date:
Subject: Re: Fix possible 'unexpected data beyond EOF' on replica restart
Next
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Proposal: Cascade REPLICA IDENTITY changes to leaf partitions