Re: pg_stat_replication docs incomplete for logical replication

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_replication docs incomplete for logical replication
Date: 2026-06-16 10:52:13
Message-ID: CAE9k0Pm=DhO5+EpR+Xot=Un5gcRd2mPTBpKjgqVcFmOmopmRyw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter,

Thanks for reviewing the patch and sharing your feedback. Please find
my responses inline below:

On Tue, Jun 16, 2026 at 10:46 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Hi Ashutosh.
>
> +1 to clarify documentation.
>
> Some minor review comments.
>
> ======
>
> doc/src/sgml/monitoring.sgml
>
> (27.2.4. pg_stat_replication)
>
> 1.
> + <para>
> + For physical replication, the LSN columns in this view describe the
> + positions up to which WAL has been sent, written, flushed, and replayed
> + on the connected standby server. For logical replication,
> + <structfield>sent_lsn</structfield> reflects the LSN up to which the
> + walsender has processed WAL records. Such records may already have been
> + streamed to the subscriber, queued for streaming at transaction commit, or
> + skipped because they were not eligible for logical decoding.
> +
> + <structfield>write_lsn</structfield>, <structfield>flush_lsn</structfield>,
> + and <structfield>replay_lsn</structfield> reflect progress reported by the
> + subscriber through replication status messages, and do not necessarily
> + mean that logical changes up to those LSNs have already been
> + received, durably stored, or made visible on the subscriber.
> </para>
>
> 1a.
> I'm not sure of the purpose of that blank line; it doesn't affect the
> rendering in HTML.
>

Agreed - this had no impact on the final output and was only added for
readability purposes. I have removed it accordingly.

> ~
>
> 1b.
> Consider splitting the text differently so there is 1 paragraph for
> "Physical Replication" and 1 paragraph for "Logical Replication". So,
> the same content just with different <para> markup.
>
> SUGGESTION
> <para>
> For physical replication, ...
> </para>
> <para>
> For logical replication, ...
> </para>
>

Updated as suggested.

> ~~~
>
> 2.
> <structfield>write_lsn</structfield> <type>pg_lsn</type>
> </para>
> <para>
> - Last write-ahead log location written to disk by this standby
> - server
> + For physical replication, the last write-ahead log location written
> + to disk by this standby server. For logical replication, progress
> + reported by the subscriber through replication status messages.
> </para></entry>
> </row
>
> For that 2nd sentence, do you mean /progress reported/progress is reported/
>
> Or, here is some alternate wording:
> For logical replication, progress is reported by replication status
> messages received from the subscriber.
>

Updated as suggested. The same change has also been applied to
flush_lsn and replay_lsn where similar feedback applied.

Please find the updated patch attached and let me know for any further
comments, thanks.

--
With Regards,
Ashutosh Sharma.

Attachment Content-Type Size
0001-doc-clarify-pg_stat_replication-view-for-logical-rep.patch application/octet-stream 6.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2026-06-16 11:08:03 Re: Support EXCEPT for TABLES IN SCHEMA publications
Previous Message Ewan Young 2026-06-16 10:51:48 Re: 004_timeline_switch TAP test may fail