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

From: James Coleman <jtc331(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: 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-05 20:04:50
Message-ID: CAAaqYe-QEF5N=OcayojuFbFqmbx=esQcjh-uZePfnctAt7HJyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 5, 2021 at 12:36 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
>
>
>
> On 2021/03/05 22:45, David Steele wrote:
> > Hi Fujii,
> >
> > On 9/8/20 1:17 PM, James Coleman wrote:
> >> On Tue, Aug 18, 2020 at 12:25 PM Fujii Masao
> >> <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote:
> >>> Thanks for updating the patch! But it failed to be applied to the master branch
> >>> cleanly because of the recent commit 0038f94387. So could you update the patch
> >>> again?
> >>
> >> Updated patch attached.
> >
> > Any thoughts on the updated patch?
>
> Thanks for the ping!
>
> With the patch, if hot_standby is enabled, the message
> "the database system is starting up" is output while the server is
> in PM_RECOVERY state until it reaches the consistent recovery point.
> On the other hand, if hot_standby is not enabled, the message
> "the database system is up, but hot_standby is off" is output even
> while the server is in that same situation. That is, opposite
> messages can be output for the same situation based on the setting
> of hot_standby. One message is "system is starting up", the other
> is "system is up". Isn't this rather confusing?

Do you have any thoughts on what you'd like to see the message be? I
could change the PM_RECOVERY (without hot standby enabled) to return
CAC_RECOVERY which would give us the message "the database system is
in recovery mode", but that would be a change from what that state
returns now in a way that's unrelated to the goal of the patch.

Thanks,
James

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-03-05 20:37:49 Re: Nicer error when connecting to standby with hot_standby=off
Previous Message Joel Jacobson 2021-03-05 19:46:24 Re: [PATCH] regexp_positions ( string text, pattern text, flags text ) → setof int4range[]