Re: Seeking datacenter PITR backup suggestions - Mailing list pgsql-general

From Gregory Stark
Subject Re: Seeking datacenter PITR backup suggestions
Date
Msg-id 87lkbvlam9.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Seeking datacenter PITR backup suggestions  (Steve Crawford <scrawford@pinpointresearch.com>)
Responses Re: Seeking datacenter PITR backup suggestions  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: Seeking datacenter PITR backup suggestions  (Decibel! <decibel@decibel.org>)
List pgsql-general
"Steve Crawford" <scrawford@pinpointresearch.com> writes:

> 4. Much more up-to-the-minute recovery data.
>
> In your scenario, what about using "cp -l" (or "ln") instead? Since the
> hard-link it is only creating a new pointer, it will be very fast and
> save a bunch of disk IO on your server and it doesn't appear that the
> tempdir is for much other than organizing purposes anyway.

Postgres tries to reuse WAL files. Once the archive_command completes it
believes it is safe to reuse the old file without deleting it. That will do
nasty things if you've used ln as your archive command.


> I'm setting up some test machines to learn more about PITR and warm
> backups and am considering a two-stage process using "cp -l" to add the
> file to the list needing transfer and regular rsync to actually move the
> files to the destination machine. (The destination machine will be over
> a WAN link so I'd like to avoid having PG tied up waiting for each rsync
> to complete.)

In theory the only thing that the archive command blocks is the reuse of WAL
log files. So as long as the command is running if Postgres has used up all
its existing WAL files it will have to create new ones which does have some
performance cost. But otherwise it's unaffected.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Can this function be declared IMMUTABLE?
Next
From: Steve Crawford
Date:
Subject: Re: Seeking datacenter PITR backup suggestions