Re: Report bytes and transactions actually sent downtream

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Report bytes and transactions actually sent downtream
Date: 2026-03-16 11:10:01
Message-ID: CAA4eK1LBKxMarniqFo31UOfeLkZv8EMkxENaWnpBZXBAsm3VtQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 16, 2026 at 1:21 PM Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com> wrote:
>
> 1) v20260316-0001-Report-downstream-sent-bytes-in-pg_stat_replication_.patch:
>
> This patch introduces sent_bytes to report the amount of data sent
> downstream. It documents sent_bytes in a way that it clarifies how
> sent_bytes differs from total_bytes, without modifying the existing
> documentation for total_bytes or total_txns. The patch is purely
> additive and does not alter any existing documentation.
>

*
+ <structfield>sent_bytes</structfield><type>bigint</type>
+ </para>
+ <para>
+ Amount of transaction changes sent downstream for this slot by the
+ output plugin after applying output plugin filters, if any, and
+ converting it into the output plugin format.

BTW, this also contains changes from pgoutput_message() which could be
non-transactional. So, saying transaction changes may not be
appropriate.

* We also send keep_alive kind of messages via wal_sender, those are
not counted in sent_bytes. If we don't want to include those then does
that need a mention?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-03-16 11:16:51 Re: PGPROC alignment (was Re: pgsql: Separate RecoveryConflictReasons from procsignals)
Previous Message Peter Eisentraut 2026-03-16 10:57:14 Re: pg_upgrade fails when extension_control_path is used