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

Skip to content

Commit bd34e7f

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 cb366b5 commit bd34e7f

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
@@ -1655,6 +1655,14 @@ BaseBackup(void)
16551655
if (maxrate > 0)
16561656
maxrate_clause = psprintf("MAX_RATE %u", maxrate);
16571657

1658+
if (verbose)
1659+
fprintf(stderr,
1660+
_("%s: initiating base backup, waiting for checkpoint to complete\n"),
1661+
progname);
1662+
1663+
if (showprogress && !verbose)
1664+
fprintf(stderr, "waiting for checkpoint\r");
1665+
16581666
basebkp =
16591667
psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s",
16601668
escaped_label,
@@ -1691,6 +1699,9 @@ BaseBackup(void)
16911699

16921700
strlcpy(xlogstart, PQgetvalue(res, 0, 0), sizeof(xlogstart));
16931701

1702+
if (verbose)
1703+
fprintf(stderr, _("%s: checkpoint completed\n"), progname);
1704+
16941705
/*
16951706
* 9.3 and later sends the TLI of the starting point. With older servers,
16961707
* assume it's the same as the latest timeline reported by

0 commit comments

Comments
 (0)
0