Re: question: data file update when pg_basebackup in progress

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Rui Hai Jiang <ruihaijiang(at)msn(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: question: data file update when pg_basebackup in progress
Date: 2017-04-26 00:06:32
Message-ID: CAB7nPqRj90hnZoNqmgFpLpbd1yS1bQ72vf3cBw4Fg2Zsgh8K=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 26, 2017 at 1:45 AM, David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> The first write to a page after a checkpoint is always recorded in the WAL
> as a full page write. Every WAL file since the checkpoint must also be
> copied to the backed up system. The replay of those WAL files is what
> brings the remote and local system into sync with respect to all changes
> since the backup checkpoint.

Bringing to the point that the presence of backup_label in a backup is
critical, as this tells Postgres from which position in WAL it should
begin recovery to bring the system up to a consistent state.
pg_basebackup also makes sure that the last WAL segment needed is
archived before the backup completes so as recovery can completely be
done.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2017-04-26 00:26:33 Re: PG 10 release notes
Previous Message Michael Paquier 2017-04-26 00:02:51 Re: PG 10 release notes