Re: pg_stat_replication view

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_stat_replication view
Date: 2018-12-11 01:57:33
Message-ID: 20181211015733.GD1473@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2018-12-11 04:52:33 Re: What is the tuplestore?
Previous Message Tom Lane 2018-12-11 00:45:01 Re: Memory exhaustion due to temporary tables?