Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Re: pg_standby ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 15598 of 17437
Post > Topic >>

Re: pg_standby stuck on a wal file size <16MB

by gsmith@[EMAIL PROTECTED] (Greg Smith) May 18, 2008 at 12:37 AM

On Sat, 17 May 2008, Ioannis Tambouras wrote:

> The archive command tests if the wal segment exists and is a file,
> but it does not check if the file is still being written.

That's because it doesn't have to; the archive command doesn't get called 
until the writing is done.

> I don't have sources of pg_standby near me, but I remember in the
> C code checks for complete segment sizes.

That's on the receiving side, to make sure it's not trying to process 
files that haven't finished copying to the standby yet.  You don't have to

do any of that in the archive_command.

Anyway, back to the original question:

> archive_command = 'test ! -f /usr/local/wal_archive_local/%f && cp %p 
> /usr/local/wal_archive_local/%f'
> archive files are then moved  on master to standby every other minute:
> rsync -aq --remove-sent-files /usr/local/wal_archive_local/ 
> slave::wal_archive/

I don't see any mechanism here to keep rsync from copying over partial 
files to the standby before they've finished copying to the 
wal_archive_local directory.  That's my guess for where the small files 
are coming from, rsync before the cp is done.  If you're going to buffer 
in a transfer directory, you need some sort of test or locking to make 
sure the file is complete with exactly 16MB before it gets rsync'd over. 
I suspect no amount of poking at the standby will root out the issue 
because it's happening on the primary.

--
* Greg Smith gsmith@[EMAIL PROTECTED]
 http://www.gregsmith.com
Baltimore, MD

-- 
Sent via pgsql-general mailing list (pgsql-general@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 2 Posts in Topic:
Re: pg_standby stuck on a wal file size <16MB
gsmith@[EMAIL PROTECTED]   2008-05-18 00:37:46 
Re: pg_standby stuck on a wal file size <16MB
vkosilov@[EMAIL PROTECTED  2008-05-20 15:44:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 12:31:39 CST 2008.