Re: Nicer error when connecting to standby with hot_standby=off

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, James Coleman <jtc331(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, David Zhang <david(dot)zhang(at)highgo(dot)ca>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Nicer error when connecting to standby with hot_standby=off
Date: 2021-03-09 13:47:34
Message-ID: 20210309134734.GA6607@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Mar-07, Magnus Hagander wrote:

> On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
> > > Here's an idea:
> > >
> > > * hot_standby=on, before reaching consistent state
> > > FATAL: database is not accepting connections
> > > DETAIL: Consistent state has not yet been reached.
> > >
> > > * hot_standby=off, past consistent state
> > > FATAL: database is not accepting connections
> > > DETAIL: Hot standby mode is disabled.
> > >
> > > * hot_standby=off, before reaching consistent state
> > > FATAL: database is not accepting connections
[...]
> > > DETAIL: Hot standby mode is disabled.

> > I prefer the former message. Because the latter message meams that
> > we need to output the different messages based on whether the consistent
> > state is reached or not, and the followings would be necessary to implement
> > that. This looks a bit overkill to me against the purpose, at least for me.
>
> Agreed. If hot standby is off, why would the admin care about whether
> it's consistent yet or not?

Great, so we're agreed on the messages to emit. James, are you updating
your patch, considering Fujii's note about the new signal and pmstate
that need to be added?

--
Álvaro Herrera 39°49'30"S 73°17'W

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Coleman 2021-03-09 14:03:16 Re: Nicer error when connecting to standby with hot_standby=off
Previous Message David Steele 2021-03-09 13:40:46 Re: DROP relation IF EXISTS Docs and Tests - Bug Fix