pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedIt is not documented that pg_promote can exit standby mode
7+ messages / 5 participants
[nested] [flat]
Commits from this thread:
2020-04-21 67f82e966b Mention pg_promote() as a method to trigger promotion in documentation.
* It is not documented that pg_promote can exit standby mode
@ 2020-04-17 04:11 ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 7+ messages in thread
From: ikedamsh @ 2020-04-17 04:11 UTC (permalink / raw)
To: pgsql-hackers
Hi,
The document(high-availability.sgml) says that there are only two ways
to exit standby mode.
26.2.2. Standby Server Operation
Standby mode is exited and the server switches to normal operation when
pg_ctl promote is run or a trigger file is found (promote_trigger_file).
But there is another way, by calling pg_promote function.
I think we need to document it, doesn't it?
I attached a patch. Please review and let me know your thoughts.
Regards,
Masahiro Ikeda
Attachments:
0001-fix-doc-about-the-way-to-exit-standby-mode.patch (text/x-diff, 1.2K) download
From 719b754c36f4537aaab7c6de1951d7b7ec4759f6 Mon Sep 17 00:00:00 2001
From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Date: Tue, 7 Apr 2020 08:34:55 +0900
Subject: [PATCH] fix doc about the way to exit standby mode
---
doc/src/sgml/high-availability.sgml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml
index 4659b9e..88bf960 100644
--- a/doc/src/sgml/high-availability.sgml
+++ b/doc/src/sgml/high-availability.sgml
@@ -644,8 +644,8 @@ protocol to make nodes agree on a serializable transactional order.
<para>
Standby mode is exited and the server switches to normal operation
- when <command>pg_ctl promote</command> is run or a trigger file is found
- (<varname>promote_trigger_file</varname>). Before failover,
+ when <command>pg_ctl promote</command> is run, <function>pg_promote</function> is called,
+ or a trigger file is found(<varname>promote_trigger_file</varname>). Before failover,
any WAL immediately available in the archive or in <filename>pg_wal</filename> will be
restored, but no attempt is made to connect to the master.
</para>
--
1.8.3.1
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
@ 2020-04-17 04:40 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-17 04:54 ` Re: It is not documented that pg_promote can exit standby mode Michael Paquier <michael@paquier.xyz>
2020-04-17 17:46 ` Re: It is not documented that pg_promote can exit standby mode Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 7+ messages in thread
From: Fujii Masao @ 2020-04-17 04:40 UTC (permalink / raw)
To: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
On 2020/04/17 13:11, ikedamsh wrote:
> Hi,
>
> The document(high-availability.sgml) says that there are only two ways to exit standby mode.
>
> 26.2.2. Standby Server Operation
> Standby mode is exited and the server switches to normal operation when pg_ctl promote is run or a trigger file is found (promote_trigger_file).
>
> But there is another way, by calling pg_promote function.
> I think we need to document it, doesn't it?
>
> I attached a patch. Please review and let me know your thoughts.
Thanks for the report and the patch! It looks good to me.
Barring any objection, I will commit this patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2020-04-17 04:54 ` Michael Paquier <michael@paquier.xyz>
2020-04-17 06:51 ` Re: It is not documented that pg_promote can exit standby mode Laurenz Albe <laurenz.albe@cybertec.at>
1 sibling, 1 reply; 7+ messages in thread
From: Michael Paquier @ 2020-04-17 04:54 UTC (permalink / raw)
To: Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
On Fri, Apr 17, 2020 at 01:40:02PM +0900, Fujii Masao wrote:
> Thanks for the report and the patch! It looks good to me.
> Barring any objection, I will commit this patch.
+1.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-17 04:54 ` Re: It is not documented that pg_promote can exit standby mode Michael Paquier <michael@paquier.xyz>
@ 2020-04-17 06:51 ` Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 7+ messages in thread
From: Laurenz Albe @ 2020-04-17 06:51 UTC (permalink / raw)
To: Michael Paquier <michael@paquier.xyz>; Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
On Fri, 2020-04-17 at 13:54 +0900, Michael Paquier wrote:
> On Fri, Apr 17, 2020 at 01:40:02PM +0900, Fujii Masao wrote:
> > Thanks for the report and the patch! It looks good to me.
> > Barring any objection, I will commit this patch.
>
> +1.
+1. That was my omission in the original patch.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2020-04-17 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-04-20 11:38 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
1 sibling, 1 reply; 7+ messages in thread
From: Tom Lane @ 2020-04-17 17:46 UTC (permalink / raw)
To: Fujii Masao <masao.fujii@oss.nttdata.com>; +Cc: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
Fujii Masao <masao.fujii@oss.nttdata.com> writes:
> Thanks for the report and the patch! It looks good to me.
> Barring any objection, I will commit this patch.
It might be worth writing "<function>pg_promote()</function> is called"
(adding parentheses) to make it clearer that a function is being
referred to. No objection otherwise.
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-17 17:46 ` Re: It is not documented that pg_promote can exit standby mode Tom Lane <tgl@sss.pgh.pa.us>
@ 2020-04-20 11:38 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-21 05:07 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 1 reply; 7+ messages in thread
From: Fujii Masao @ 2020-04-20 11:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
On 2020/04/18 2:46, Tom Lane wrote:
> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
>> Thanks for the report and the patch! It looks good to me.
>> Barring any objection, I will commit this patch.
>
> It might be worth writing "<function>pg_promote()</function> is called"
> (adding parentheses) to make it clearer that a function is being
> referred to. No objection otherwise.
Yes. Also Masahiro-san reported me, off-list, that there are other places
where pg_promote is mentioned without parentheses. I think it's better to
add parentheses there. Attached is the updated version of the patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:
0001-fix-doc-about-the-way-to-exit-standby-mode_v2.patch (text/plain, 2.3K) download
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index a71ca62463..a14df06292 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -4114,7 +4114,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
Specifies a trigger file whose presence ends recovery in the
standby. Even if this value is not set, you can still promote
the standby using <command>pg_ctl promote</command> or calling
- <function>pg_promote</function>.
+ <function>pg_promote()</function>.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
</para>
diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml
index 4659b9ef5d..52e47379cc 100644
--- a/doc/src/sgml/high-availability.sgml
+++ b/doc/src/sgml/high-availability.sgml
@@ -644,7 +644,8 @@ protocol to make nodes agree on a serializable transactional order.
<para>
Standby mode is exited and the server switches to normal operation
- when <command>pg_ctl promote</command> is run or a trigger file is found
+ when <command>pg_ctl promote</command> is run,
+ <function>pg_promote()</function> is called, or a trigger file is found
(<varname>promote_trigger_file</varname>). Before failover,
any WAL immediately available in the archive or in <filename>pg_wal</filename> will be
restored, but no attempt is made to connect to the master.
@@ -1470,11 +1471,11 @@ synchronous_standby_names = 'ANY 2 (s1, s2, s3)'
<para>
To trigger failover of a log-shipping standby server, run
- <command>pg_ctl promote</command>, call <function>pg_promote</function>,
+ <command>pg_ctl promote</command>, call <function>pg_promote()</function>,
or create a trigger file with the file name and path specified by the
<varname>promote_trigger_file</varname>. If you're planning to use
<command>pg_ctl promote</command> or to call
- <function>pg_promote</function> to fail over,
+ <function>pg_promote()</function> to fail over,
<varname>promote_trigger_file</varname> is not required. If you're
setting up the reporting servers that are only used to offload read-only
queries from the primary, not for high availability purposes, you don't
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: It is not documented that pg_promote can exit standby mode
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-17 17:46 ` Re: It is not documented that pg_promote can exit standby mode Tom Lane <tgl@sss.pgh.pa.us>
2020-04-20 11:38 ` Re: It is not documented that pg_promote can exit standby mode Fujii Masao <masao.fujii@oss.nttdata.com>
@ 2020-04-21 05:07 ` Fujii Masao <masao.fujii@oss.nttdata.com>
0 siblings, 0 replies; 7+ messages in thread
From: Fujii Masao @ 2020-04-21 05:07 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: ikedamsh <ikedamsh@oss.nttdata.com>; pgsql-hackers
On 2020/04/20 20:38, Fujii Masao wrote:
>
>
> On 2020/04/18 2:46, Tom Lane wrote:
>> Fujii Masao <masao.fujii@oss.nttdata.com> writes:
>>> Thanks for the report and the patch! It looks good to me.
>>> Barring any objection, I will commit this patch.
>>
>> It might be worth writing "<function>pg_promote()</function> is called"
>> (adding parentheses) to make it clearer that a function is being
>> referred to. No objection otherwise.
>
> Yes. Also Masahiro-san reported me, off-list, that there are other places
> where pg_promote is mentioned without parentheses. I think it's better to
> add parentheses there. Attached is the updated version of the patch.
Pushed. Thanks!
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2020-04-21 05:07 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 04:11 It is not documented that pg_promote can exit standby mode ikedamsh <ikedamsh@oss.nttdata.com>
2020-04-17 04:40 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-17 04:54 ` Michael Paquier <michael@paquier.xyz>
2020-04-17 06:51 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-04-17 17:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-04-20 11:38 ` Fujii Masao <masao.fujii@oss.nttdata.com>
2020-04-21 05:07 ` Fujii Masao <masao.fujii@oss.nttdata.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox