From: | Venkata Balaji Nagothi <vbnpgc(at)gmail(dot)com> |
---|---|
To: | AI Rumman <rummandba(at)gmail(dot)com> |
Cc: | pgsql-general General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: When does pg_archivecleanup work? |
Date: | 2014-03-12 02:34:27 |
Message-ID: | CAHBAh5tgL22+ypv1u+EGd5iez743xpE6yKqRo4YmC1xwbBGB0Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Mar 12, 2014 at 10:03 AM, AI Rumman <rummandba(at)gmail(dot)com> wrote:
As I have very low wal_keep_segments compare to my wal generation, I am
> collecting archive wal files at slave.
> Now in order to clean up archive wal collection directory at slave, I used
> "archive_cleanup_command".
> I watched that after archive wal files were pilling up at slave and after
> certain point it was cleared up.
> But still I didn't get the idea when it will be executed and clean up my
> directory.
>
> Example: recovery.conf that I used:
> standby_mode = 'on' # enables stand-by (readonly) mode
> primary_conninfo = 'host= 10.0.0.1 port= 5432 user= replicator
> password=replicator'
> trigger_file = '/pgdata/pgsql.trigger.5432'
> restore_command = 'cp /archivewal/%f %p'
> archive_cleanup_command = '$HOME/bin/pg_archivecleanup /archivewal %r'
>
To best way to track the frequency of when the clean-up is happening (in
your environment) is to log output and examine the log file output after a
certain period of time.
Something like below :
*archive_cleanup_command = '$HOME/bin/pg_archivecleanup /archivewal %r 2>>
/tmp/archivecleanup.log'*
Generally - "%r" implies all the WAL archives before the last restart point
( In-short - WAL archives not needed for recovery) will be delete by
pg_archivecleanup. Example : If i am recovering from an online backup, then
%r picks up information regarding the oldest WAL archive file needed/kept
from the "backup label" and deletes all the archive files prior to that.
To better understand at what frequency the files are getting deleted,
please log the output as mentioned above.
Please let us know the PG version you are using
Regards,
Venkata Balaji N
Sr. Database Administrator
Fujitsu Australia
From | Date | Subject | |
---|---|---|---|
Next Message | Roy Anderson | 2014-03-12 03:00:12 | Materialized view from PG to Oracle? |
Previous Message | Kevin Grittner | 2014-03-12 02:33:13 | Re: How do I track down a possible locking problem? |