Re: [PostgreSQL 10] default of hot_standby should be "on"?

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Banck <michael(dot)banck(at)credativ(dot)de>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Hiroshi Yanagisawa <hir-yanagisawa(at)ut(dot)jp(dot)nec(dot)com>
Subject: Re: [PostgreSQL 10] default of hot_standby should be "on"?
Date: 2017-05-03 21:00:29
Message-ID: CABUevEyFk2cbpqqNDVLrgbHPEGLa+BV7nu4HAETBL8rK9Df_LA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 3, 2017 at 4:18 PM, Michael Banck <michael(dot)banck(at)credativ(dot)de>
wrote:

> Hi,
>
> On Tue, May 02, 2017 at 11:13:58AM +0200, Magnus Hagander wrote:
> > Looks good to me as well. Applied, with only a minor further docs
> addition
> > saying that this is the default also on the high availability page.
>
> I understand this is late, but a colleague alerted me to the following
> behaviour change: If you recover a server with default settings, it is
> our understanding that pg_isready will now return true immediately after
> the consistent state is reached and possibly well before recovery had
> actually ended (depending on the amount of outstanding wal). As hot
> standby works with log shipping, this is independent of the
> recovery.conf settings, i.e. even if standby_mode and primary_conninfo
> are not set. So if one was monitoring recovery like that before and
> expects pg_isready to only return true once the recovery is fully
> complete, this will now have to be adjusted. Also, if the recovered
> server is to be used for transactions, there will now be a window where
> the server accepts connections, but is in read-only mode.
>
> Before, one had the make the concious choice to set hot_standby to get
> the behaviour, now it might be surprising to users, or maybe I'm
> overthinking this?
>
> If that is indeed the case, maybe it should be mentioned more
> prominently in the documentation and/or get highlighted in the release
> notes?
>

Hmm. That's an interesting usecase.

I don't think it's a big enough one to revert this change, but it
definitely makes sense to mention it under incompatible changes.

I wonder if what we really want here, at least long-term, is a flag for
pg_isready that makes it wait for a server to actually go out of
recovery?`Seems that a tool like the one mentioned here would have to do
that -- it can be done now by doing pg_isready first and then psql to check
the status, but it seems like it could be a worthwhile addition?

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-05-03 21:02:33 Re: PROVE_FLAGS
Previous Message Tom Lane 2017-05-03 20:42:56 Re: WITH clause in CREATE STATISTICS