Re: pg_stat_replication view - Mailing list pgsql-general

From Michael Paquier
Subject Re: pg_stat_replication view
Date
Msg-id 20181211015733.GD1473@paquier.xyz
Whole thread Raw
In response to pg_stat_replication view  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
On Mon, Dec 10, 2018 at 02:24:43PM -0500, Jeff Janes wrote:
> What does this mean?  Is the standby "caught up" when it replays the LSN
> which was current on the master as-of the time that the standby initiated
> this connection?  Or is it caught up when the master receives at least one
> notification that a certain LSN was replayed on the replica, and verifies
> that no new WAL has been generated after that certain LSN was generated?
> Neither of those things?

The WAL sender would switch from catchup to streaming mode when it sees
that there is no more data to send to the standby.  Please look for the
call of WalSndSetState(WALSNDSTATE_STREAMING) in walsender.c.

> If a replica has caught up and then fallen behind again, is that different
> from a user/dba perspective than if it never caught up in the first
> place?

Not really, because it means that it has been able to catch up with the
latest LSN of the primary at least once.  Perhaps you have suggestions
to improve the documentation?
--
Michael

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Memory exhaustion due to temporary tables?
Next
From: Ron
Date:
Subject: Re: What is the tuplestore?