Skip to content

Commit 744ddc6

Browse files
committed
Document restrictions regarding incremental backups and standbys.
If you try to take an incremental backup on a standby and there hasn't been much system activity, it might fail. Document why this happens. Also add a hint to the error message you get, to make it more likely that users will understand what has gone wrong. Laurenz Albe and Robert Haas Discussion: https://postgr.es/m/5468641ad821dad7aa3b2d65bf843146443a1b68.camel@cybertec.at
1 parent 580f872 commit 744ddc6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

doc/src/sgml/backup.sgml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,17 @@ test ! -f /mnt/server/archivedir/00000001000000A900000065 && cp pg_wal/0
925925
to manage. For a large database all of which is heavily modified,
926926
incremental backups won't be much smaller than full backups.
927927
</para>
928+
929+
<para>
930+
An incremental backup is only possible if replay would begin from a later
931+
checkpoint than for the previous backup upon which it depends. If you
932+
take the incremental backup on the primary, this condition is always
933+
satisfied, because each backup triggers a new checkpoint. On a standby,
934+
replay begins from the most recent restartpoint. Therefore, an
935+
incremental backup of a standby server can fail if there has been very
936+
little activity since the previous backup, since no new restartpoint might
937+
have been created.
938+
</para>
928939
</sect2>
929940

930941
<sect2 id="backup-lowlevel-base-backup">

src/backend/backup/basebackup_incremental.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,8 @@ PrepareForIncrementalBackup(IncrementalBackupInfo *ib,
441441
errmsg("manifest requires WAL from final timeline %u ending at %X/%X, but this backup starts at %X/%X",
442442
range->tli,
443443
LSN_FORMAT_ARGS(range->end_lsn),
444-
LSN_FORMAT_ARGS(backup_state->startpoint))));
444+
LSN_FORMAT_ARGS(backup_state->startpoint)),
445+
errhint("This can happen for incremental backups on a standby if there was little activity since the previous backup.")));
445446
}
446447
else
447448
{

0 commit comments

Comments
 (0)