Re: Do results of pg_start_backup work without WAL segments created during backup?

From: Rui DeSousa <rui(at)crazybean(dot)net>
To: Thorsten Schöning <tschoening(at)am-soft(dot)de>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Do results of pg_start_backup work without WAL segments created during backup?
Date: 2019-07-08 14:40:28
Message-ID: 1A4A685C-7840-464A-8EEB-704E6423240B@crazybean.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On Jul 8, 2019, at 9:10 AM, Thorsten Schöning <tschoening(at)am-soft(dot)de> wrote:
>
> Guten Tag David Steele,
> am Montag, 8. Juli 2019 um 14:12 schrieben Sie:
>
>> pg_start_backup() does a checkpoint, but then the database continues
>> writing as you copy the files in whatever order you choose. You may
>> copy a file that has a partial write or copy some files involved in a
>> transaction before it happens and others afterwards -- in fact this is
>> normal and expected.
>
> And because that's expected, Postgres can successfully restore from
> that, e.g. having used checkpoints before:

Thorsten,

A checkpoint can not sync data that has already been backed up. Also, the files are being actively written too while the back is occurring thus the backup contains suspected pages.

Postgres needs the WALs to resolve any issues that were created by the backup. Without the WALs you have a corrupted/suspect database.

It’s just like crash recovery; the database has to replay everything since the last checkpoint. However, with a backup… the checkpoint is pg_start_backup().

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Stephen Frost 2019-07-08 14:49:11 Re: When it's really necessary to enable WAR archiving in case of low level backups?
Previous Message Juan José Santamaría Flecha 2019-07-08 14:21:24 Re: Como transformar punto decimal a coma decimal