Re: Report bytes and transactions actually sent downtream

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Aditya Gollamudi <adigollamudi(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, michael(at)paquier(dot)xyz, bertranddrouvot(dot)pg(at)gmail(dot)com, andres(at)anarazel(dot)de, shveta(dot)malik(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Report bytes and transactions actually sent downtream
Date: 2026-08-20 12:25:59
Message-ID: CAE9k0PkJ2kdZwW1042KuvctxvHd8mEOSO+D7_Q3uUAcwLUdHvA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for reviewing the patch.

On Thu, Aug 20, 2026 at 8:32 AM Aditya Gollamudi <adigollamudi(at)gmail(dot)com> wrote:
>
> Hi Ashutosh!
>
> Thanks for the updated patches. I reviewed the latest two as
> part of the July patch review workshop:
>
> First, I wasn't able to cleanly apply the refactoring patch against the
> current tree. It could be an issue on my end, but it may need to be
> checked again.
>

I'll rebase and share the updated patch.

> Secondly, this was mentioned earlier in the thread and handled for
> the SQL API path but I believe an excess 25 bytes is still being
> counted by output_bytes in the WALsender path because of an
> unaccounted for header.
>
> In WalSndPrepareWrite(), we call pq_sendbyte() and pq_sendint64()
> twice in order to send some header data. In order to be consistent
> with the renaming to "output_bytes" I think that should not
> be included. One way this could be fixed is through an offset that
> simply accounts for this header data, and subtracts it from output_bytes:
>

I think the difference is in how output_bytes is interpreted. It is
intended to represent the bytes prepared for the consumer, including
output-writer framing where applicable, rather than only the bytes
produced by the output plugin. Maybe we can clarify this in the
documentation so that it precisely matches the implementation.

Regarding test-cases, I will revisit and see if anything newer can be added.

--
With Regards,
Ashutosh Sharma.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nazir Bilal Yavuz 2026-08-20 12:31:40 Re: aio: Don't silently drop wait_event_info
Previous Message Nazir Bilal Yavuz 2026-08-20 12:09:19 Re: [PATCH v1] Fix races in Windows pthread emulation