8000 Back-patch checkpoint clarification docs and pg_basebackup updates · thatguystone/postgres@2843d5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 2843d5d

Browse files
committed
Back-patch checkpoint clarification docs and pg_basebackup updates
This backpatches 51e26c9 and 7220c7b, including both documentation updates clarifying the checkpoints at the beginning of base backups and the messages in verbose and progress mdoe of pg_basebackup. Author: Michael Banck Discussion: https://postgr.es/m/21444.1488142764%40sss.pgh.pa.us
1 parent 0ef26bb commit 2843d5d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

doc/src/sgml/ref/pg_basebackup.sgml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ PostgreSQL documentation
361361
<term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term>
362362
<listitem>
363363
<para>
364-
Sets checkpoint mode to fast or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
364+
Sets checkpoint mode to fast (immediate) or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
365365
</para>
366366
</listitem>
367367
</varlistentry>
@@ -568,6 +568,14 @@ PostgreSQL documentation
568568
<refsect1>
569569
<title>Notes</title>
570570

571+
<para>
572+
At the beginning of the backup, a checkpoint needs to be written on the
573+
server the backup is taken from. Especially if the option
574+
<literal>--checkpoint=fast</literal> is not used, this can take some time
575+
during which <application>pg_basebackup</application> will be appear
576+
to be idle.
577+
</para>
578+
571579
<para>
572580
The backup will include all files in the data directory and tablespaces,
573581
including the configuration files and any additional files placed in the

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,14 @@ BaseBackup(void)
16431643
if (maxrate > 0)
16441644
maxrate_clause = psprintf("MAX_RATE %u", maxrate);
16451645

1646+
if (verbose)
1647+
fprintf(stderr,
1648+
_("%s: initiating base backup, waiting for checkpoint to complete\n"),
1649+
progname);
1650+
1651+
if (showprogress && !verbose)
1652+
fprintf(stderr, "waiting for checkpoint\r");
1653+
16461654
basebkp =
16471655
psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s",
16481656
escaped_label,
@@ -1680,6 +1688,9 @@ BaseBackup(void)
16801688

16811689
strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart));
16821690

1691+
if (verbose)
1692+
fprintf(stderr, _("%s: checkpoint completed\n"), progname);
1693+
16831694
/*
16841695
* 9.3 and later sends the TLI of the starting point. With older servers,
16851696
* assume it's the same as the latest timeline reported by

0 commit comments

Comments
 (0)
0