Re: BUG #16879: Delayed standby does not connect to primary on startup

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: mahadevan(at)rapidloop(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16879: Delayed standby does not connect to primary on startup
Date: 2021-02-22 00:06:27
Message-ID: 0f654d04-5d07-4e75-b995-d2271466f125@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Feb 21, 2021, at 6:39 AM, PG Bug reporting form wrote:
> We have a customer who reported pg_last_wal_receive_lsn() returning NULL on
> a delayed standby, and this is what the investigation led to.
This is not a bug. It is working as documented.

"If streaming replication is disabled, or if it has not yet started, the
function returns NULL." [1]

In this scenario, server was (re)started but it cannot streaming because of
recovery_min_apply_delay setting, hence, the pg_last_wal_receive_lsn() returns
NULL. When the standby applies the first transaction (after 1h), this function
will return a non-NULL value.

[1] https://www.postgresql.org/docs/13/functions-admin.html#FUNCTIONS-RECOVERY-CONTROL

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2021-02-22 01:28:50 Re: Unexpected serialization error
Previous Message PG Bug reporting form 2021-02-21 12:27:47 BUG #16880: running into 2 error when trying to install