pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pallav Kalva <pkalva@livedatagroup.com>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Steve Crawford <scrawford@pinpointresearch.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Archive Command Configuration
Date: Fri, 24 Mar 2006 10:39:41 -0500
Message-ID: <442412BD.6090706@livedatagroup.com> (raw)
In-Reply-To: <20060324114222.GV90527@pervasive.com>
References: <4422FD80.5080009@livedatagroup.com>
	<442304F9.4090708@pinpointresearch.com>
	<20060324114222.GV90527@pervasive.com>

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.






view thread (9+ messages)  latest in thread

Message-ID: <442412BD.6090706@livedatagroup.com>
Permalink:  ../442412BD.6090706@livedatagroup.com/
Also on:    postgresql.org/message-id/442412BD.6090706@livedatagroup.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: pkalva@livedatagroup.com, jnasby@pervasive.com, scrawford@pinpointresearch.com
  Subject: Re: Archive Command Configuration
  In-Reply-To: <442412BD.6090706@livedatagroup.com>
  References: <4422FD80.5080009@livedatagroup.com> <442304F9.4090708@pinpointresearch.com> <20060324114222.GV90527@pervasive.com> <442412BD.6090706@livedatagroup.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox