[PostgreSQL 10] default of hot_standby should be "on"?
Hi,
Default for hot_standby parameter should be "on" from PostgreSQL 10?
In PostgreSQL 10, -w option is default for [pg_ctl start].
So in order to start standby we have to setting hot_standby to "on" or
start standby with -W option.
Change hot_standby to "on" will fix this inconvenience.
wal_level is also changed default to "replica" in PostgreSQL 10,
this might not be affect to primary.
Just a little bit but I attached the patch.
---
Thanks and best regards,
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/
Attachments:
hot_standby.patchapplication/octet-stream; name=hot_standby.patchDownload
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a414fb2..587fbce 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1571,7 +1571,7 @@ static struct config_bool ConfigureNamesBool[] =
NULL
},
&EnableHotStandby,
- false,
+ true,
NULL, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index c02f7f3..0886aac 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -254,7 +254,7 @@
# These settings are ignored on a master server.
-#hot_standby = off # "on" allows queries during recovery
+#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
On 26 April 2017 at 08:30, Huong Dangminh <huo-dangminh@ys.jp.nec.com> wrote:
Default for hot_standby parameter should be "on" from PostgreSQL 10?
In PostgreSQL 10, -w option is default for [pg_ctl start].
So in order to start standby we have to setting hot_standby to "on" or
start standby with -W option.
Yeah. That's a good reason to change it. I think at this point warm
standby is clearly the less-used secondary option and hot_standby
should be default.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Apr 26, 2017 at 9:36 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
On 26 April 2017 at 08:30, Huong Dangminh <huo-dangminh@ys.jp.nec.com> wrote:
Default for hot_standby parameter should be "on" from PostgreSQL 10?
In PostgreSQL 10, -w option is default for [pg_ctl start].
So in order to start standby we have to setting hot_standby to "on" or
start standby with -W option.Yeah. That's a good reason to change it. I think at this point warm
standby is clearly the less-used secondary option and hot_standby
should be default.
The idea of changing the default value seems good to me but I'm not
sure it's good idea to change the default value now under the
circumstances where we're focus on stabilization.
Also we should update the document as well.
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Masahiko Sawada
The idea of changing the default value seems good to me but I'm not sure
it's good idea to change the default value now under the circumstances where
we're focus on stabilization.
Also we should update the document as well.
We can consider like this: the OP found a usability problem as a result of PG 10 development, so we will fix it as a stabilization work.
Regards
Takayuki Tsunakawa
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Apr 26, 2017 at 07:33:27AM +0000, Tsunakawa, Takayuki wrote:
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Masahiko Sawada
The idea of changing the default value seems good to me but I'm not sure
it's good idea to change the default value now under the circumstances where
we're focus on stabilization.
Also we should update the document as well.We can consider like this: the OP found a usability problem as a result of PG 10 development, so we will fix it as a stabilization work.
We did work in Postgres 10 to make replication simpler with better
defaults. This would be part of that improvement.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Apr 26, 2017 at 1:25 PM, Bruce Momjian <bruce@momjian.us> wrote:
On Wed, Apr 26, 2017 at 07:33:27AM +0000, Tsunakawa, Takayuki wrote:
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Masahiko
Sawada
The idea of changing the default value seems good to me but I'm not
sure
it's good idea to change the default value now under the circumstances
where
we're focus on stabilization.
Also we should update the document as well.We can consider like this: the OP found a usability problem as a result
of PG 10 development, so we will fix it as a stabilization work.
We did work in Postgres 10 to make replication simpler with better
defaults. This would be part of that improvement.
+1. I definitely think we should do it, and 10 would be the time to do it.
The failure scenario is that a standby node will no longer work by default
*if* you have changed the master to minimal. But unless you have explicitly
dropped that one, it would work.
So I definitely think we should change that.
I wonder if we should also consider changing the standby error message to
be a WARNING instead of an ERROR. So that if you try to start up a standby
with hot_standby=on but master with wal_level=replica it would turn into a
cold standby.
We should change the default independently of that, I think, but it might
make sense to do both.
--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
Magnus Hagander <magnus@hagander.net> writes:
+1. I definitely think we should do it, and 10 would be the time to do it.
Agreed. It's mainly a historical accident that the default is what it is,
I think.
I wonder if we should also consider changing the standby error message to
be a WARNING instead of an ERROR. So that if you try to start up a standby
with hot_standby=on but master with wal_level=replica it would turn into a
cold standby.
I'm -1 for that: if you fat-finger the configuration, you should be told
about it, not have the system start up in an unintended mode that lacks
critical functionality.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Apr 26, 2017 at 9:52 PM, Magnus Hagander <magnus@hagander.net>
wrote:
I wonder if we should also consider changing the standby error message to
be a WARNING instead of an ERROR. So that if you try to start up a standby
with hot_standby=on but master with wal_level=replica it would turn into a
cold standby.Perhaps, you mean hot_standby=off here?
Regards,
Vaishnavi
Fujitsu Australia.
Thanks all for your comments.
Magnus Hagander <magnus@hagander.net> writes:
+1. I definitely think we should do it, and 10 would be the time to do
it.
Agreed. It's mainly a historical accident that the default is what it
is,
I think.I wonder if we should also consider changing the standby error message
to
be a WARNING instead of an ERROR. So that if you try to start up a standby
with hot_standby=on but master with wal_level=replica it would turn intoa
cold standby.
I'm -1 for that: if you fat-finger the configuration, you should be told
about it, not have the system start up in an unintended mode that lacks
critical functionality.regards, tom lane
I attached the patch which also update manual as the mention of sawada-san.
---
Thanks and best regards,
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/
Attachments:
hot_standby.patchapplication/octet-stream; name=hot_standby.patchDownload
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e02b0c8..0b9e300 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3227,7 +3227,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<para>
Specifies whether or not you can connect and run queries during
recovery, as described in <xref linkend="hot-standby">.
- The default value is <literal>off</literal>.
+ The default value is <literal>on</literal>.
This parameter can only be set at server start. It only has effect
during archive recovery or in standby mode.
</para>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a414fb2..587fbce 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1571,7 +1571,7 @@ static struct config_bool ConfigureNamesBool[] =
NULL
},
&EnableHotStandby,
- false,
+ true,
NULL, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index c02f7f3..fceef14 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -254,7 +254,7 @@
# These settings are ignored on a master server.
-#hot_standby = off # "on" allows queries during recovery
+#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
On Thu, Apr 27, 2017 at 9:54 AM, Huong Dangminh
<huo-dangminh@ys.jp.nec.com> wrote:
Thanks all for your comments.
Magnus Hagander <magnus@hagander.net> writes:
+1. I definitely think we should do it, and 10 would be the time to do
it.
Agreed. It's mainly a historical accident that the default is what it
is,
I think.I wonder if we should also consider changing the standby error message
to
be a WARNING instead of an ERROR. So that if you try to start up a standby
with hot_standby=on but master with wal_level=replica it would turn intoa
cold standby.
I'm -1 for that: if you fat-finger the configuration, you should be told
about it, not have the system start up in an unintended mode that lacks
critical functionality.regards, tom lane
I attached the patch which also update manual as the mention of sawada-san.
Thank you for updating the patch. Also maybe we can update line in
PostgresNode.pm where hot_standby is set to on explicitly.
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Thu, Apr 27, 2017 at 11:48 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
Thank you for updating the patch. Also maybe we can update line in
PostgresNode.pm where hot_standby is set to on explicitly.
I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Thu, Apr 27, 2017 at 11:48 AM, Masahiko Sawada <sawada.mshk@gmail.com>
wrote:Thank you for updating the patch. Also maybe we can update line in
PostgresNode.pm where hot_standby is set to on explicitly.I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.
--
Michael
Thanks, attached patch update PostgresNode.pm file.
I also did the regression test and found no problem.
# sorry Sawada-san, Michael-san, because of security restriction
# we could not mail to gmail address from our environment.
---
Thanks and best regards,
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/
Attachments:
hot_standby.patchapplication/octet-stream; name=hot_standby.patchDownload
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e02b0c8..0b9e300 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3227,7 +3227,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<para>
Specifies whether or not you can connect and run queries during
recovery, as described in <xref linkend="hot-standby">.
- The default value is <literal>off</literal>.
+ The default value is <literal>on</literal>.
This parameter can only be set at server start. It only has effect
during archive recovery or in standby mode.
</para>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a414fb2..587fbce 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1571,7 +1571,7 @@ static struct config_bool ConfigureNamesBool[] =
NULL
},
&EnableHotStandby,
- false,
+ true,
NULL, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index c02f7f3..fceef14 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -254,7 +254,7 @@
# These settings are ignored on a master server.
-#hot_standby = off # "on" allows queries during recovery
+#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 51cbec8..16f7181 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -17,10 +17,6 @@ PostgresNode - class representing PostgreSQL server instance
# Start the PostgreSQL server
$node->start();
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();
-
# run a query with psql, like:
# echo 'SELECT 1' | psql -qAXt postgres -v ON_ERROR_STOP=1
$psql_stdout = $node->safe_psql('postgres', 'SELECT 1');
@@ -432,7 +428,6 @@ sub init
print $conf "max_wal_size = 128MB\n";
print $conf "shared_buffers = 1MB\n";
print $conf "wal_log_hints = on\n";
- print $conf "hot_standby = on\n";
print $conf "max_connections = 10\n";
}
else
On Thu, Apr 27, 2017 at 1:58 PM, Huong Dangminh
<huo-dangminh@ys.jp.nec.com> wrote:
On Thu, Apr 27, 2017 at 11:48 AM, Masahiko Sawada <sawada.mshk@gmail.com>
wrote:Thank you for updating the patch. Also maybe we can update line in
PostgresNode.pm where hot_standby is set to on explicitly.I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.
Hmm, you've got a point. But when we changed the default values
related to replication we dropped some explicitly settings from the
regression test code.
Thanks, attached patch update PostgresNode.pm file.
I also did the regression test and found no problem.
Looks good to me.
# sorry Sawada-san, Michael-san, because of security restriction
# we could not mail to gmail address from our environment.
No problem!
---
Thanks and best regards,
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Thu, Apr 27, 2017 at 4:33 PM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
On Thu, Apr 27, 2017 at 1:58 PM, Huong Dangminh
<huo-dangminh@ys.jp.nec.com> wrote:On Thu, Apr 27, 2017 at 11:48 AM, Masahiko Sawada <sawada.mshk@gmail.com>
wrote:Thank you for updating the patch. Also maybe we can update line in
PostgresNode.pm where hot_standby is set to on explicitly.I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.Hmm, you've got a point. But when we changed the default values
related to replication we dropped some explicitly settings from the
regression test code.
Looking at the patch. This is fine:
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();
But not that:
print $conf "wal_log_hints = on\n";
- print $conf "hot_standby = on\n";
print $conf "max_connections = 10\n";
This is a minor point though.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.Hmm, you've got a point. But when we changed the default values
related to replication we dropped some explicitly settings from the
regression test code.Looking at the patch. This is fine:
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();But not that:
print $conf "wal_log_hints = on\n";
- print $conf "hot_standby = on\n";
print $conf "max_connections = 10\n";This is a minor point though.
Thanks, I attached the update patch.
---
Thanks and best regards,
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/
Attachments:
hot_standby.patchapplication/octet-stream; name=hot_standby.patchDownload
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index e02b0c8..0b9e300 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3227,7 +3227,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
<para>
Specifies whether or not you can connect and run queries during
recovery, as described in <xref linkend="hot-standby">.
- The default value is <literal>off</literal>.
+ The default value is <literal>on</literal>.
This parameter can only be set at server start. It only has effect
during archive recovery or in standby mode.
</para>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index a414fb2..587fbce 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -1571,7 +1571,7 @@ static struct config_bool ConfigureNamesBool[] =
NULL
},
&EnableHotStandby,
- false,
+ true,
NULL, NULL, NULL
},
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index c02f7f3..fceef14 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -254,7 +254,7 @@
# These settings are ignored on a master server.
-#hot_standby = off # "on" allows queries during recovery
+#hot_standby = on # "off" disallows queries during recovery
# (change requires restart)
#max_standby_archive_delay = 30s # max delay before canceling queries
# when reading WAL from archive;
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 51cbec8..db305ff 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -17,10 +17,6 @@ PostgresNode - class representing PostgreSQL server instance
# Start the PostgreSQL server
$node->start();
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();
-
# run a query with psql, like:
# echo 'SELECT 1' | psql -qAXt postgres -v ON_ERROR_STOP=1
$psql_stdout = $node->safe_psql('postgres', 'SELECT 1');
On Thu, Apr 27, 2017 at 11:05 PM, Huong Dangminh
<huo-dangminh@ys.jp.nec.com> wrote:
I would refrain from doing that, having some parameters listed in the
tests makes the intention behind those perl routines clear.Hmm, you've got a point. But when we changed the default values
related to replication we dropped some explicitly settings from the
regression test code.Looking at the patch. This is fine:
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();But not that:
print $conf "wal_log_hints = on\n";
- print $conf "hot_standby = on\n";
print $conf "max_connections = 10\n";This is a minor point though.
After some thoughts I agree to remain it in the perl code.
Thanks, I attached the update patch.
So it looks good to me.
Regards,
--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Fri, Apr 28, 2017 at 3:43 AM, Masahiko Sawada <sawada.mshk@gmail.com>
wrote:
On Thu, Apr 27, 2017 at 11:05 PM, Huong Dangminh
<huo-dangminh@ys.jp.nec.com> wrote:I would refrain from doing that, having some parameters listed in
the
tests makes the intention behind those perl routines clear.
Hmm, you've got a point. But when we changed the default values
related to replication we dropped some explicitly settings from the
regression test code.Looking at the patch. This is fine:
- # Change a setting and restart
- $node->append_conf('postgresql.conf', 'hot_standby = on');
- $node->restart();But not that:
print $conf "wal_log_hints = on\n";
- print $conf "hot_standby = on\n";
print $conf "max_connections = 10\n";This is a minor point though.
After some thoughts I agree to remain it in the perl code.
Thanks, I attached the update patch.
So it looks good to me.
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. And per
the comments from Michael, I did not include the change to PostgresNode.pm.
Thanks!
--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>
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?
Michael
--
Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael.banck@credativ.de
credativ GmbH, HRB M�nchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 M�nchengladbach
Gesch�ftsf�hrung: Dr. Michael Meskes, J�rg Folz, Sascha Heuer
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, May 3, 2017 at 4:18 PM, Michael Banck <michael.banck@credativ.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/>