Re: Nicer error when connecting to standby with hot_standby=off - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Nicer error when connecting to standby with hot_standby=off
Date
Msg-id 20200310000655.xud47fagckfodoqb@alap3.anarazel.de
Whole thread Raw
In response to Re: Nicer error when connecting to standby with hot_standby=off  (James Coleman <jtc331@gmail.com>)
Responses Re: Nicer error when connecting to standby with hot_standby=off  (James Coleman <jtc331@gmail.com>)
List pgsql-hackers
Hi,

On 2020-03-09 18:40:32 -0400, James Coleman wrote:
> On Mon, Mar 9, 2020 at 6:28 PM Andres Freund <andres@anarazel.de> wrote:
> > > I wanted to get some initial feedback on the idea before writing a patch:
> > > does that seem like a reasonable change? Is it actually plausible to
> > > distinguish between this state and "still recovering" (i.e., when starting
> > > up a hot standby but initial recovery hasn't completed so it legitimately
> > > can't accept connections yet)? If so, should we include the possibility if
> > > hot_standby isn't on, just in case?
> >
> > Yes, it is feasible to distinguish those cases. And we should, if we're
> > going to change things around.
> 
> I'll look into this hopefully soon, but it's helpful to know that it's
> possible. Is it basically along the lines of checking to see if the
> LSN is past the minimum recovery point?

No, I don't think that's the right approach. IIRC the startup process
(i.e. the one doing the WAL replay) signals postmaster once consistency
has been achieved. So you can just use that state.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Add absolute value to dict_int
Next
From: Peter Geoghegan
Date:
Subject: Re: Improve search for missing parent downlinks in amcheck