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

2021-04-09 Thread James Coleman
On Wed, Mar 24, 2021 at 9:43 PM Fujii Masao wrote: > > > > On 2021/03/24 22:06, James Coleman wrote: > > That looks good to me. Thanks for working on this. > > Thanks! I pushed the patch. > > Regards, > > -- > Fujii Masao > Advanced Computing Technology Center > Research and Development Headquarte

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

2021-03-24 Thread Fujii Masao
On 2021/03/24 22:06, James Coleman wrote: That looks good to me. Thanks for working on this. Thanks! I pushed the patch. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

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

2021-03-24 Thread James Coleman
On Wed, Mar 24, 2021 at 5:55 AM Fujii Masao wrote: > > > > On 2021/03/24 16:59, Alvaro Herrera wrote: > > On 2021-Mar-24, Fujii Masao wrote: > > > >> On 2021/03/24 5:59, Tom Lane wrote: > >>> Alvaro Herrera writes: > FATAL: the database system is starting up > DETAIL: WAL is being app

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

2021-03-24 Thread Fujii Masao
On 2021/03/24 16:59, Alvaro Herrera wrote: On 2021-Mar-24, Fujii Masao wrote: On 2021/03/24 5:59, Tom Lane wrote: Alvaro Herrera writes: FATAL: the database system is starting up DETAIL: WAL is being applied to recover from a system crash. or DETAIL: The system is applying WAL to recove

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

2021-03-24 Thread Alvaro Herrera
On 2021-Mar-24, Fujii Masao wrote: > On 2021/03/24 5:59, Tom Lane wrote: > > Alvaro Herrera writes: > > > FATAL: the database system is starting up > > > DETAIL: WAL is being applied to recover from a system crash. > > > or > > > DETAIL: The system is applying WAL to recover from a system cras

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

2021-03-23 Thread Fujii Masao
On 2021/03/24 5:59, Tom Lane wrote: Alvaro Herrera writes: FATAL: the database system is starting up DETAIL: WAL is being applied to recover from a system crash. or DETAIL: The system is applying WAL to recover from a system crash. or DETAIL: The startup process is applying WAL to recove

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

2021-03-23 Thread Tom Lane
Alvaro Herrera writes: > FATAL: the database system is starting up > DETAIL: WAL is being applied to recover from a system crash. > or > DETAIL: The system is applying WAL to recover from a system crash. > or > DETAIL: The startup process is applying WAL to recover from a system crash. I don'

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

2021-03-23 Thread Alvaro Herrera
On 2021-Mar-24, Fujii Masao wrote: > On 2021/03/24 1:20, Alvaro Herrera wrote: > > Please note that PM_STARTUP mode is very very short-lived. It only > > starts happening when postmaster launches the startup process, and > > before the startup process begins WAL replay (as changed by > > sigusr1

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

2021-03-23 Thread Fujii Masao
On 2021/03/24 1:20, Alvaro Herrera wrote: On 2021-Mar-23, James Coleman wrote: On Tue, Mar 23, 2021 at 1:46 AM Fujii Masao wrote: Therefore for now what we've not reached the consensus is what message should be logged at PM_STARTUP. I'm thinking it's better to log "the database system is

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

2021-03-23 Thread James Coleman
On Tue, Mar 23, 2021 at 12:34 PM Tom Lane wrote: > > Alvaro Herrera writes: > > However, for this one > > > + case CAC_NOTCONSISTENT: > > + if (EnableHotStandby) > > + ereport(FATAL, > > + (errcode(ERRCODE_CANNOT_CONNECT_NOW), > > +

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

2021-03-23 Thread Tom Lane
Alvaro Herrera writes: > However, for this one > + case CAC_NOTCONSISTENT: > + if (EnableHotStandby) > + ereport(FATAL, > + (errcode(ERRCODE_CANNOT_CONNECT_NOW), > +errmsg("the database system is not accepting > connecti

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

2021-03-23 Thread Alvaro Herrera
On 2021-Mar-23, James Coleman wrote: > On Tue, Mar 23, 2021 at 1:46 AM Fujii Masao > wrote: > > Therefore for now what we've not reached the consensus is what message > > should be logged at PM_STARTUP. I'm thinking it's better to log > > "the database system is starting up" in that case becaus

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

2021-03-23 Thread James Coleman
On Tue, Mar 23, 2021 at 1:46 AM Fujii Masao wrote: > > > > On 2021/03/23 3:59, James Coleman wrote: > > Are you saying we should only change the message for a single case: > > the case where we'd otherwise allow connections but EnableHotStandby > > is false? > > No. Let me clarify my opinion. > >

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

2021-03-22 Thread Fujii Masao
On 2021/03/23 3:59, James Coleman wrote: Are you saying we should only change the message for a single case: the case where we'd otherwise allow connections but EnableHotStandby is false? No. Let me clarify my opinion. At PM_STARTUP, "the database system is starting up" should be logged wha

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

2021-03-22 Thread James Coleman
On Mon, Mar 22, 2021 at 2:52 PM Fujii Masao wrote: > > > > On 2021/03/23 3:25, James Coleman wrote: > > On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao > > wrote: > >> > >> > >> > >> On 2021/03/19 23:35, James Coleman wrote: > >>> Here's an updated patch; I think I've gotten what Alvaro suggested. >

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

2021-03-22 Thread Fujii Masao
On 2021/03/23 3:25, James Coleman wrote: On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao wrote: On 2021/03/19 23:35, James Coleman wrote: Here's an updated patch; I think I've gotten what Alvaro suggested. Thanks for updating the patch! But I was thinking that our consensus is something li

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

2021-03-22 Thread James Coleman
On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao wrote: > > > > On 2021/03/19 23:35, James Coleman wrote: > > Here's an updated patch; I think I've gotten what Alvaro suggested. > > Thanks for updating the patch! But I was thinking that our consensus is > something like the attached patch. Could you ch

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

2021-03-22 Thread Fujii Masao
On 2021/03/19 23:35, James Coleman wrote: Here's an updated patch; I think I've gotten what Alvaro suggested. Thanks for updating the patch! But I was thinking that our consensus is something like the attached patch. Could you check this patch? Regards, -- Fujii Masao Advanced Computing Tec

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

2021-03-19 Thread James Coleman
On Tue, Mar 9, 2021 at 9:27 AM Fujii Masao wrote: > > > > On 2021/03/09 23:19, James Coleman wrote: > > On Tue, Mar 9, 2021 at 9:17 AM Alvaro Herrera > > wrote: > >> > >> On 2021-Mar-09, James Coleman wrote: > >> > >>> Yes, I think they both agreed on the "DETAIL: Hot standby mode is > >>> disa

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

2021-03-09 Thread Fujii Masao
On 2021/03/09 23:19, James Coleman wrote: On Tue, Mar 9, 2021 at 9:17 AM Alvaro Herrera wrote: On 2021-Mar-09, James Coleman wrote: Yes, I think they both agreed on the "DETAIL: Hot standby mode is disabled." message, but that alternative meant not needing to add any new signals and pm s

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

2021-03-09 Thread James Coleman
On Tue, Mar 9, 2021 at 9:17 AM Alvaro Herrera wrote: > > On 2021-Mar-09, James Coleman wrote: > > > Yes, I think they both agreed on the "DETAIL: Hot standby mode is > > disabled." message, but that alternative meant not needing to add any > > new signals and pm states, correct? > > Ah, I see! I

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

2021-03-09 Thread Alvaro Herrera
On 2021-Mar-09, James Coleman wrote: > Yes, I think they both agreed on the "DETAIL: Hot standby mode is > disabled." message, but that alternative meant not needing to add any > new signals and pm states, correct? Ah, I see! I was thinking that you still needed the state and signal in order to

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

2021-03-09 Thread Magnus Hagander
On Tue, Mar 9, 2021 at 3:07 PM Alvaro Herrera wrote: > > On 2021-Mar-09, James Coleman wrote: > > > On Tue, Mar 9, 2021 at 8:47 AM Alvaro Herrera > > wrote: > > > > > > On 2021-Mar-07, Magnus Hagander wrote: > > > > > > > On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao > > > > wrote: > > > > > > Gr

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

2021-03-09 Thread James Coleman
On Tue, Mar 9, 2021 at 9:07 AM Alvaro Herrera wrote: > > On 2021-Mar-09, James Coleman wrote: > > > On Tue, Mar 9, 2021 at 8:47 AM Alvaro Herrera > > wrote: > > > > > > On 2021-Mar-07, Magnus Hagander wrote: > > > > > > > On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao > > > > wrote: > > > > > > Gr

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

2021-03-09 Thread Alvaro Herrera
On 2021-Mar-09, James Coleman wrote: > On Tue, Mar 9, 2021 at 8:47 AM Alvaro Herrera wrote: > > > > On 2021-Mar-07, Magnus Hagander wrote: > > > > > On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao > > > wrote: > > > > Great, so we're agreed on the messages to emit. James, are you updating > > your

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

2021-03-09 Thread James Coleman
On Tue, Mar 9, 2021 at 8:47 AM Alvaro Herrera wrote: > > On 2021-Mar-07, Magnus Hagander wrote: > > > On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao > > wrote: > > > > > > Here's an idea: > > > > > > > > * hot_standby=on, before reaching consistent state > > > >FATAL: database is not accepting

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

2021-03-09 Thread Alvaro Herrera
On 2021-Mar-07, Magnus Hagander wrote: > On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao > 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.

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

2021-03-07 Thread Magnus Hagander
On Sun, Mar 7, 2021 at 3:39 PM Fujii Masao wrote: > > > > On 2021/03/06 5:37, Alvaro Herrera wrote: > > On 2021-Mar-05, James Coleman wrote: > > > >> 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 > >>

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

2021-03-07 Thread Fujii Masao
On 2021/03/06 5:37, Alvaro Herrera wrote: On 2021-Mar-05, James Coleman wrote: 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 rec

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

2021-03-05 Thread Alvaro Herrera
On 2021-Mar-05, James Coleman wrote: > 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

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

2021-03-05 Thread James Coleman
On Fri, Mar 5, 2021 at 12:36 PM Fujii Masao 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 > >> wrote: > >>> Thanks for updating the patch! But it failed to be applied to the m

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

2021-03-05 Thread Fujii Masao
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 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 updat

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

2021-03-05 Thread David Steele
Hi Fujii, On 9/8/20 1:17 PM, James Coleman wrote: On Tue, Aug 18, 2020 at 12:25 PM Fujii Masao 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.

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

2020-09-08 Thread James Coleman
On Tue, Aug 18, 2020 at 12:25 PM Fujii Masao 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. James v3-0001-Improve-standby-connection-de

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

2020-08-18 Thread Fujii Masao
On 2020/08/01 5:18, James Coleman wrote: On Wed, Jul 29, 2020 at 11:24 AM Fujii Masao wrote: On 2020/04/03 22:49, James Coleman wrote: On Thu, Apr 2, 2020 at 5:53 PM David Zhang wrote: The following review has been posted through the commitfest application: make installcheck-world: n

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

2020-07-31 Thread James Coleman
On Wed, Jul 29, 2020 at 11:24 AM Fujii Masao wrote: > > > > On 2020/04/03 22:49, James Coleman wrote: > > On Thu, Apr 2, 2020 at 5:53 PM David Zhang wrote: > >> > >> The following review has been posted through the commitfest application: > >> make installcheck-world: not tested > >> Implements

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

2020-07-29 Thread Fujii Masao
On 2020/04/03 22:49, James Coleman wrote: On Thu, Apr 2, 2020 at 5:53 PM David Zhang wrote: The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, passed Spec compliant: not tested Documentati

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

2020-04-03 Thread James Coleman
On Thu, Apr 2, 2020 at 5:53 PM David Zhang wrote: > > The following review has been posted through the commitfest application: > make installcheck-world: not tested > Implements feature: tested, passed > Spec compliant: not tested > Documentation:not tested > > I appli

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

2020-04-02 Thread David Zhang
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, passed Spec compliant: not tested Documentation:not tested I applied the patch to the latest master branch and run a test below. The

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

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 8:06 PM Andres Freund wrote: > > Hi, > > On 2020-03-09 18:40:32 -0400, James Coleman wrote: > > On Mon, Mar 9, 2020 at 6:28 PM Andres Freund wrote: > > > > I wanted to get some initial feedback on the idea before writing a > > > > patch: > > > > does that seem like a reaso

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

2020-03-09 Thread Andres Freund
Hi, On 2020-03-09 18:40:32 -0400, James Coleman wrote: > On Mon, Mar 9, 2020 at 6:28 PM Andres Freund 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 st

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

2020-03-09 Thread James Coleman
On Mon, Mar 9, 2020 at 6:28 PM Andres Freund wrote: > > Hi, > > On 2020-03-08 20:12:21 -0400, James Coleman wrote: > > I recently noticed while setting up a test environment that attempting to > > connect to a standby running without hot_standby=on results in a fairly > > generic error (I believe

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

2020-03-09 Thread Andres Freund
Hi, On 2020-03-08 20:12:21 -0400, James Coleman wrote: > I recently noticed while setting up a test environment that attempting to > connect to a standby running without hot_standby=on results in a fairly > generic error (I believe "the database system is starting up"). I don't > have my test setu