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

Allow pg_basebackup from standby node with safety checking.

Base backup follows recommended procedure, plus goes to great
lengths to ensure that partial page writes are avoided.

Jun Ishizuka and Fujii Masao, with minor modifications
This commit is contained in:
Simon Riggs
2012-01-25 18:02:04 +00:00
parent 74ab96a45e
commit 8366c7803e
11 changed files with 501 additions and 44 deletions

View File

@ -64,6 +64,48 @@ PostgreSQL documentation
better from a performance point of view to take only one backup, and copy
the result.
</para>
<para>
<application>pg_basebackup</application> can make a base backup from
not only the master but also the standby. To take a backup from the standby,
set up the standby so that it can accept replication connections (that is, set
<varname>max_wal_senders</> and <xref linkend="guc-hot-standby">,
and configure <link linkend="auth-pg-hba-conf">host-based authentication</link>).
You will also need to enable <xref linkend="guc-full-page-writes"> on the master.
</para>
<para>
Note that there are some limitations in an online backup from the standby:
<itemizedlist>
<listitem>
<para>
The backup history file is not created in the database cluster backed up.
</para>
</listitem>
<listitem>
<para>
There is no guarantee that all WAL files required for the backup are archived
at the end of backup. If you are planning to use the backup for an archive
recovery and want to ensure that all required files are available at that moment,
you need to include them into the backup by using <literal>-x</> option.
</para>
</listitem>
<listitem>
<para>
If the standby is promoted to the master during online backup, the backup fails.
</para>
</listitem>
<listitem>
<para>
All WAL records required for the backup must contain sufficient full-page writes,
which requires you to enable <varname>full_page_writes</> on the master and
not to use the tool like <application>pg_compresslog</> as
<varname>archive_command</> to remove full-page writes from WAL files.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1>