how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11?

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11?
Date: 2021-09-24 16:46:02
Message-ID: CALj2ACXjoR09BaDGu-WGFJxj2LG1KtnADRxpMqMLASPX8ovtLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I'm trying to set up a postgres server with version 11 in targeted
recovery mode (for the first time after my journey started with
postgres) and I came across the explanation at [1] in PG 12 and newer
versions that we have a clear differentiation as to what is the
"standby" mode or "targeted recovery" mode. How do we differentiate
these two modes in PG 11? Can anyone please help me with it?

PS: hackers-list may not be the right place to ask, but I'm used to
seeking help from it.

[1] From the https://www.postgresql.org/docs/12/runtime-config-wal.html:

"19.5.4. Archive Recovery

This section describes the settings that apply only for the duration
of the recovery. They must be reset for any subsequent recovery you
wish to perform.

“Recovery” covers using the server as a standby or for executing a
targeted recovery. Typically, standby mode would be used to provide
high availability and/or read scalability, whereas a targeted recovery
is used to recover from data loss.

To start the server in standby mode, create a file called
standby.signal in the data directory. The server will enter recovery
and will not stop recovery when the end of archived WAL is reached,
but will keep trying to continue recovery by connecting to the sending
server as specified by the primary_conninfo setting and/or by fetching
new WAL segments using restore_command. For this mode, the parameters
from this section and Section 19.6.3 are of interest. Parameters from
Section 19.5.5 will also be applied but are typically not useful in
this mode.

To start the server in targeted recovery mode, create a file called
recovery.signal in the data directory. If both standby.signal and
recovery.signal files are created, standby mode takes precedence.
Targeted recovery mode ends when the archived WAL is fully replayed,
or when recovery_target is reached. In this mode, the parameters from
both this section and Section 19.5.5 will be used."

Regards,
Bharath Rupireddy.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-09-24 16:55:00 Re: extensible options syntax for replication parser?
Previous Message Robert Haas 2021-09-24 16:28:59 Re: .ready and .done files considered harmful