1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Remove promote_trigger_file.

Previously, an idle startup (recovery) process would wake up every 5
seconds to have a chance to poll for promote_trigger_file, even if that
GUC was not configured.  That promotion triggering mechanism was
effectively superseded by pg_ctl promote and pg_promote() a long time
ago.  There probably aren't many users left and it's very easy to change
to the modern mechanisms, so we agreed to remove the feature.

This is part of a campaign to reduce wakeups on idle systems.

Author: Simon Riggs <simon.riggs@enterprisedb.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Robert Haas <robertmhaas@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Ian Lawrence Barwick <barwick@gmail.com>
Discussion: https://postgr.es/m/CANbhV-FsjnzVOQGBpQ589%3DnWuL1Ex0Ykn74Nh1hEjp2usZSR5g%40mail.gmail.com
This commit is contained in:
Thomas Munro
2022-11-29 11:28:08 +13:00
parent f0cd57f852
commit cd4329d939
7 changed files with 29 additions and 93 deletions

View File

@ -34,14 +34,11 @@
</para>
<para>
The
<literal>trigger_file</literal>
<indexterm>
<primary>trigger_file</primary>
<see>promote_trigger_file</see>
</indexterm>
setting has been renamed to
<xref linkend="guc-promote-trigger-file"/>.
PostgreSQL 15 and below had a setting
<literal>promote_trigger_file</literal>, or
<literal>trigger_file</literal> before 12.
Use <command>pg_ctl promote</command> or call
<function>pg_promote()</function> to promote a standby instead.
</para>
<para>

View File

@ -4610,24 +4610,6 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
</listitem>
</varlistentry>
<varlistentry id="guc-promote-trigger-file" xreflabel="promote_trigger_file">
<term><varname>promote_trigger_file</varname> (<type>string</type>)
<indexterm>
<primary><varname>promote_trigger_file</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
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>.
This parameter can only be set in the <filename>postgresql.conf</filename>
file or on the server command line.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-hot-standby" xreflabel="hot_standby">
<term><varname>hot_standby</varname> (<type>boolean</type>)
<indexterm>

View File

@ -653,11 +653,10 @@ 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,
<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 primary.
when <command>pg_ctl promote</command> is run, or
<function>pg_promote()</function> is called. 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 primary.
</para>
</sect2>
@ -1483,15 +1482,10 @@ 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>,
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,
<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
need to promote it.
<command>pg_ctl promote</command> or call <function>pg_promote()</function>.
If you're setting up reporting servers that are only used to offload
read-only queries from the primary, not for high availability purposes,
you don't need to promote.
</para>
</sect1>