Re: Replica vs standby

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: Euler Taveira <euler(at)eulerto(dot)com>, yanliang lei <msdnchina(at)163(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Replica vs standby
Date: 2023-09-06 14:34:24
Message-ID: ZPiN8PB6JH7OlLP2@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Sep 6, 2023 at 09:02:02AM +0200, Peter Eisentraut wrote:
> On 06.09.23 03:42, Bruce Momjian wrote:
> > There are other cases in our docs where we call something a standby and
> > mean only a physical standby/replica. Should these be clarified?
>
> When "hot standby" was added, I argued that it's not really a standby if
> it's hot. The response was that this is sort of a standard industry term,
> and we should read "standby" to be equivalent to "replica". Which I think
> is good enough. Obviously, the term "standby" is baked into many
> user-visible interfaces, so it's not clear whether there is a clean path to
> improving anything here.

If we don't want to change the standby == replica assumption, we still
need improvement.

How do we describe physical replicas in the docs?

https://www.postgresql.org/docs/devel/runtime-config-wal.html#RUNTIME-CONFIG-WAL-SETTINGS
wal_level (enum)

wal_level determines how much information is written to the WAL. The
default value is replica, which writes enough data to support WAL
archiving and replication, including running read-only queries on a
standby server.
--------------

That is clearly not a logical standby/replica.

If a server subscribes to one table via logical replication, is it a
replica/standby server?

https://www.postgresql.org/docs/devel/runtime-config-replication.html#RUNTIME-CONFIG-REPLICATION-SENDER
max_wal_senders (integer)

Specifies the maximum number of concurrent connections from standby
-------
servers or streaming base backup clients (i.e., the maximum number of
-------
simultaneously running WAL sender processes).

The email that started this thread was caused by confusion that logical
subscribers are part of the max_wal_senders allocation. While logical
replication _can_ be used for standby purposes, it has many other uses.

For physical replication, a hot standby can still be used for standby
purposes, while for logical replication, most of its uses cannot be used
for standby purposes.

My initial recommendation is that we keep "standby" for physical
replicas, hot and warm, and we use "replica" for physical and logical
replication receivers. In this case, replica == "receiver of
replication".

I am ready to prepare a patch to clarify all this once we decide what is
appropriate.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2023-09-06 20:53:15 Re: to_char(numeric type, text) rounding instead of truncating
Previous Message Peter Eisentraut 2023-09-06 07:02:02 Re: Replica vs standby