1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

action_at_recovery_target recovery config option

action_at_recovery_target = pause | promote | shutdown

Petr Jelinek

Reviewed by Muhammad Asif Naeem, Fujji Masao and
Simon Riggs
This commit is contained in:
Simon Riggs
2014-11-25 20:13:30 +00:00
parent bb1b8f694a
commit aedccb1f6f
4 changed files with 159 additions and 19 deletions

View File

@ -289,12 +289,39 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
</term>
<listitem>
<para>
Specifies whether recovery should pause when the recovery target
is reached. The default is true.
This is intended to allow queries to be executed against the
database to check if this recovery target is the most desirable
point for recovery. The paused state can be resumed by using
<function>pg_xlog_replay_resume()</> (See
Alias for action_at_recovery_target, <literal>true</> is same as
action_at_recovery_target = <literal>pause</> and <literal>false</>
is same as action_at_recovery_target = <literal>promote</>.
</para>
<para>
This setting has no effect if <xref linkend="guc-hot-standby"> is not
enabled, or if no recovery target is set.
</para>
</listitem>
</varlistentry>
</variablelist>
<varlistentry id="action-at-recovery-target"
xreflabel="action_at_recovery_target">
<term><varname>action_at_recovery_target</varname> (<type>enum</type>)
<indexterm>
<primary><varname>action_at_recovery_target</> recovery parameter</primary>
</indexterm>
</term>
<listitem>
<para>
Specifies what action the server should take once the recovery target is
reached. The default is <literal>pause</>, which means recovery will
be paused. <literal>promote</> means recovery process will finish and
the server will start to accept connections.
Finally <literal>shutdown</> will stop the server after reaching the
recovery target.
</para>
The intended use of <literal>pause</> setting is to allow queries to be
executed against the database to check if this recovery target is the
most desirable point for recovery. The paused state can be resumed by
using <function>pg_xlog_replay_resume()</> (See
<xref linkend="functions-recovery-control-table">), which then
causes recovery to end. If this recovery target is not the
desired stopping point, then shutdown the server, change the
@ -302,8 +329,23 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
continue recovery.
</para>
<para>
This setting has no effect if <xref linkend="guc-hot-standby"> is not
enabled, or if no recovery target is set.
The <literal>shutdown</> setting is useful to have instance ready at
exact replay point desired.
The instance will still be able to replay more WAL records (and in fact
will have to replay WAL records since last checkpoint next time it is
started).
</para>
<para>
Note that because <filename>recovery.conf</> will not be renamed when
<varname>action_at_recovery_target</> is set to <literal>shutdown</>,
any subsequent start will end with immediate shutdown unless the
configuration is changed or the <filename>recovery.conf</> is removed
manually.
</para>
<para>
This setting has no effect if no recovery target is set.
If <xref linkend="guc-hot-standby"> is not enabled, a setting of
<literal>pause</> will act the same as <literal>shutdown</>.
</para>
</listitem>
</varlistentry>