Commit 51e26c9c authored by Magnus Hagander's avatar Magnus Hagander

Clarify the role of checkpoint at the begininng of base backups

Output a message about checkpoint starting in verbose mode of
pg_basebackup, and make the documentation state more clearly that this
happens.

Author: Michael Banck
parent caa6c1f1
...@@ -862,7 +862,8 @@ SELECT pg_start_backup('label', false, false); ...@@ -862,7 +862,8 @@ SELECT pg_start_backup('label', false, false);
<xref linkend="guc-checkpoint-completion-target">). This is <xref linkend="guc-checkpoint-completion-target">). This is
usually what you want, because it minimizes the impact on query usually what you want, because it minimizes the impact on query
processing. If you want to start the backup as soon as processing. If you want to start the backup as soon as
possible, change the second parameter to <literal>true</>. possible, change the second parameter to <literal>true</>, which will
issue an immediate checkpoint using as much I/O as available.
</para> </para>
<para> <para>
......
...@@ -419,7 +419,7 @@ PostgreSQL documentation ...@@ -419,7 +419,7 @@ PostgreSQL documentation
<term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term> <term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term>
<listitem> <listitem>
<para> <para>
Sets checkpoint mode to fast or spread (default) (see <xref linkend="backup-lowlevel-base-backup">). Sets checkpoint mode to fast (immediate) or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -659,6 +659,14 @@ PostgreSQL documentation ...@@ -659,6 +659,14 @@ PostgreSQL documentation
<refsect1> <refsect1>
<title>Notes</title> <title>Notes</title>
<para>
At the beginning of the backup, a checkpoint needs to be written on the
server the backup is taken from. Especially if the option
<literal>--checkpoint=fast</literal> is not used, this can take some time
during which <application>pg_basebackup</application> will be appear
to be idle.
</para>
<para> <para>
The backup will include all files in the data directory and tablespaces, The backup will include all files in the data directory and tablespaces,
including the configuration files and any additional files placed in the including the configuration files and any additional files placed in the
......
...@@ -1753,6 +1753,14 @@ BaseBackup(void) ...@@ -1753,6 +1753,14 @@ BaseBackup(void)
if (maxrate > 0) if (maxrate > 0)
maxrate_clause = psprintf("MAX_RATE %u", maxrate); maxrate_clause = psprintf("MAX_RATE %u", maxrate);
if (verbose)
fprintf(stderr,
_("%s: initiating base backup, waiting for checkpoint to complete\n"),
progname);
if (showprogress && !verbose)
fprintf(stderr, "waiting for checkpoint\n");
basebkp = basebkp =
psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s", psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s",
escaped_label, escaped_label,
...@@ -1790,6 +1798,9 @@ BaseBackup(void) ...@@ -1790,6 +1798,9 @@ BaseBackup(void)
strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart)); strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart));
if (verbose)
fprintf(stderr, _("%s: checkpoint completed\n"), progname);
/* /*
* 9.3 and later sends the TLI of the starting point. With older servers, * 9.3 and later sends the TLI of the starting point. With older servers,
* assume it's the same as the latest timeline reported by * assume it's the same as the latest timeline reported by
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment