Re: Backup taking long time !!!

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, julyanto SUTANDANG <julyanto(at)equnix(dot)co(dot)id>, Dinesh Chandra 12108 <Dinesh(dot)Chandra(at)cyient(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Backup taking long time !!!
Date: 2017-01-23 17:32:28
Message-ID: CAMkU=1xn5LRC8=XPB7bucy0SpGPqh0UuMEARfipC+E985-6czg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jan 23, 2017 at 7:28 AM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:

> On 1/22/17 11:32 AM, Stephen Frost wrote:
>
>> The 1-second window concern is regarding the validity of a subsequent
>> incremental backup.
>>
>
> BTW, there's a simpler scenario here:
>
> Postgres touches file.
> rsync notices file has different timestamp, starts copying.
> Postgres touches file again.
>
> If those 3 steps happen in the same second, you now have an invalid
> backup. There's probably other scenarios as well.
>

To be clear, you don't have an invalid backup *now*, as replay of the WAL
will fix it up. You will have an invalid backup next time you take a
backup, using a copy of the backup you just took now as the rsync
destination of that future backup.

If you were to actually fire up a copy of the backup and go through
recovery, then shut it down, and then use that post-recovery copy as the
destination of the rsync, would that eliminate the risk (barring clock skew
between systems)?

> In short, if you're using rsync, it's *critical* that you give it the
> --checksum option, which tells rsync to ignore file size and timestamp.

Which unfortunately obliterates much of the point of using rsync for many
people. You can still save on bandwidth, but not on local IO on each end.

Cheers,

Jeff

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Simon Riggs 2017-01-23 17:43:56 Re: Backup taking long time !!!
Previous Message Stephen Frost 2017-01-23 17:23:01 Re: Backup taking long time !!!