9.0 Replication and archive cleanup

From: "Kyle R(dot) Burton" <kyle(dot)burton(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: 9.0 Replication and archive cleanup
Date: 2011-07-19 15:57:09
Message-ID: CANP+8rmHJ2Sg=WwBqZAzr604ecPpoq-Md40U+Q6PhZum0q=_kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I have a master and slave set up with replication - both xlog and
streaming replication are set up and working great. The slave keeps
up with the master and is available for read-only queries.

I just configured the archive_cleanup_command in my recovery.conf file
on the slave to use pg_archivecleanup, and restarted the slave. After
doing so, and confirming that at least 1 new xlog was shipped to the
slave, I am not seeing any evidence of the archivecleanup command
being run. No files are removed, nor is there anything in the slave's
postgres log output regarding archive cleanup.

This is my recovery.conf:

standby_mode = 'on'
primary_conninfo = 'host=<<master-ip-addr>> port=5432
user=<<user>> password=<<pass>>'
restore_command = 'cp /var/lib/postgresql/replication/db1/wal/%f %p'
trigger_file = '/var/lib/postgresql/become-master'
archive_cleanup_command =
'/usr/lib/postgresql/9.0/bin/pg_archivecleanup
/var/lib/postgresql/replication/db1/wal %r'

I am not sure if I have mis-configured things or if I'm not
understanding the relationship between the xlog shipping and streaming
replication.

Is the xlog recovery (and cleanup) not triggered when streaming
replication is enabled? If that's the case, what is a good strategy
for cleaning these up?

Regards,

Kyle

--
Twitter: @kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

Browse pgsql-admin by date

  From Date Subject
Next Message Mario Splivalo 2011-07-19 19:02:35 Replicating privileges from one user to another
Previous Message Kevin Grittner 2011-07-18 13:49:54 Re: WAL archiving to two locations in warm standby