Re: Archive Command Configuration

From: Pallav Kalva <pkalva(at)livedatagroup(dot)com>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: Steve Crawford <scrawford(at)pinpointresearch(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Archive Command Configuration
Date: 2006-03-24 15:39:41
Message-ID: 442412BD.6090706@livedatagroup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Jim C. Nasby wrote:
>On Thu, Mar 23, 2006 at 12:28:41PM -0800, Steve Crawford wrote:
>
>>>...I have a
>>>cron job from the production database that runs every 5-10min to check
>>>if there are any new archive logs and copy new archive logs to the
>>>remote stand by failover machine.
>>>
>>>The problem with this scenario is that there might be a possibility that
>>>I might scp a partially filled archive log over to the remote machine on
>>>a heavily updated databases with batch jobs runnings most of the time
>>>like ours.
>>>
>>> So, inorder to over come this we want to change the archive_command to
>>>
>>>archive_command = 'cp %p /archives-temp/%f && mv /archives-temp/%f
>>>/archives/%f'
>>>( I could do remote copy also with the command but I dont want to go
>>>that route because of network problems. )
>>>
>>>....
>>>
>>>My question is there any problem in using this approach ? will I run
>>>into problems in the future ? are there any other better ways of solving
>>>this problem ?
>>>
>>Looks like it should work but have you considered using rsync instead?
>>If the file grows from one pass to the next, rsync will send the
>>differences.
>>
>
>rsync does nothing to address the race condition issue, though. If you
>fire up an rsync and the cp takes too long, you'll end up syncing a
>partially written WAL file, which could potentially be bad.
>
>BTW, there's also now a project on pgFoundry for using PITR to keep a
>warm-backup: http://pgfoundry.org/projects/pgpitrha/
>
Hi Jim,

What do you think about this option ? If I just do scp from the
/archives folder, I will be ok and wont copy any partial files at any
time right ?
archive_command = 'cp %p /archives-temp/%f && mv /archives-temp/%f /archives/%f'


Pallav.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jim C. Nasby 2006-03-24 16:43:26 Re: Bloated pg_shdepend_depender_index
Previous Message Tom Lane 2006-03-24 15:28:36 Re: Invalid page feader on Solaris 10