Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb88b929

Browse files
committed
Back-patch checkpoint clarification docs and pg_basebackup updates
This backpatches51e26c9 and7220c7b, including both documentationupdates clarifying the checkpoints at the beginning of base backups andthe messages in verbose and progress mdoe of pg_basebackup.Author: Michael BanckDiscussion:https://postgr.es/m/21444.1488142764%40sss.pgh.pa.us
1 parentfb1879c commitb88b929

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

‎doc/src/sgml/backup.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,8 @@ SELECT pg_start_backup('label', false, false);
862862
<xref linkend="guc-checkpoint-completion-target">). This is
863863
usually what you want, because it minimizes the impact on query
864864
processing. If you want to start the backup as soon as
865-
possible, change the second parameter to <literal>true</>.
865+
possible, change the second parameter to <literal>true</>, which will
866+
issue an immediate checkpoint using as much I/O as available.
866867
</para>
867868

868869
<para>

‎doc/src/sgml/ref/pg_basebackup.sgml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ PostgreSQL documentation
382382
<term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term>
383383
<listitem>
384384
<para>
385-
Sets checkpoint mode to fast or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
385+
Sets checkpoint mode to fast(immediate)or spread (default) (see <xref linkend="backup-lowlevel-base-backup">).
386386
</para>
387387
</listitem>
388388
</varlistentry>
@@ -589,6 +589,14 @@ PostgreSQL documentation
589589
<refsect1>
590590
<title>Notes</title>
591591

592+
<para>
593+
At the beginning of the backup, a checkpoint needs to be written on the
594+
server the backup is taken from. Especially if the option
595+
<literal>--checkpoint=fast</literal> is not used, this can take some time
596+
during which <application>pg_basebackup</application> will be appear
597+
to be idle.
598+
</para>
599+
592600
<para>
593601
The backup will include all files in the data directory and tablespaces,
594602
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
@@ -1661,6 +1661,14 @@ BaseBackup(void)
16611661
if (maxrate>0)
16621662
maxrate_clause=psprintf("MAX_RATE %u",maxrate);
16631663

1664+
if (verbose)
1665+
fprintf(stderr,
1666+
_("%s: initiating base backup, waiting for checkpoint to complete\n"),
1667+
progname);
1668+
1669+
if (showprogress&& !verbose)
1670+
fprintf(stderr,"waiting for checkpoint\r");
1671+
16641672
basebkp=
16651673
psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s",
16661674
escaped_label,
@@ -1698,6 +1706,9 @@ BaseBackup(void)
16981706

16991707
strlcpy(xlogstart,PQgetvalue(res,0,0),sizeof(xlogstart));
17001708

1709+
if (verbose)
1710+
fprintf(stderr,_("%s: checkpoint completed\n"),progname);
1711+
17011712
/*
17021713
* 9.3 and later sends the TLI of the starting point. With older servers,
17031714
* assume it's the same as the latest timeline reported by

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp