Re: Extending BASE_BACKUP in replication protocol: incremental backup and backup format

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Jim Nasby <jim(at)nasby(dot)net>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extending BASE_BACKUP in replication protocol: incremental backup and backup format
Date: 2014-01-15 08:08:15
Message-ID: 52D641EF.4010104@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 01/15/2014 08:46 AM, Jim Nasby wrote:
> On 1/14/14, 7:41 AM, Magnus Hagander wrote:
>> Yes, it would be necessary to scan the whole database as the LSN
>> to be
>> checked is kept in PageHeaderData :). Perhaps it is not that
>> performant, but my initial thought was that perhaps the amount of
>> data
>> necessary to maintain incremental backups could balance with the
>> amount of WAL necessary to keep and limit the whole amount on disk.
>>
>> It wouldn't be worse performance wise than a full backup. That one
>> also has to read all the blocks after all... You're decreasing network
>> traffic and client storage, with the same I/O on the server side.
>> Seems worthwhile.
>
> If there's enough demand, it probably wouldn't be that hard to keep a
> copy of the page LSNs in a fork; you only need to ensure that the LSN in
> the fork must be older than the LSN on disk could possibly be, and you
> wouldn't have to update the fork every time.

That's backwards. You need to ensure that the LSN in the fork >= that on
disk. Otherwise the backup will incorrectly conclude that a page doesn't
need to be backed up because it hasn't been modified.

> BTW, an incremental backup could possibly be useful as a way to catch a
> streaming replica up that's fallen way behind. The write IO would be
> sequential instead of trying to random-write while processing each WAL
> record.

Yeah. And it would work even if you no longer have all the WAL files
available.

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-15 08:27:26 Re: [Lsf-pc] Linux kernel impact on PostgreSQL performance
Previous Message Jim Nasby 2014-01-15 07:36:08 Re: Capturing EXPLAIN ANALYZE for a query without discarding the normal result set