Search Postgresql Archives

Re: pg_xlog - files are guaranteed to be sequentialy named?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 13 Jun 2007, Alvaro Herrera wrote:

Johannes Konert wrote:
I currently write a small script that deletes outdated xlog-files from
my backup-location.

Warning, this is NOT SAFE to do.  You should NEVER delete "outdated"
xlog files, unless you appreciate RANDOM CORRUPTION of your data.

He's talking about wiping out the ones on the backup server, so I think Johannes means erasing the old archived logs on the secondary here. That can screw up your backup if you do it wrong, but it's not an all-caps worthy mistake.

On Wed, 13 Jun 2007, Johannes Konert wrote:
Because I do not want to rely on creation-date,

No, you want to rely on creation date, because then this problem goes away. The idea you should be working toward is that you identify when your last base backup was started after it's copied to the secondary, and then you can safely delete any archived logs file on the secondary from before that time. Instead of doing "ls | sort -g -r" you should be doing something like looping over the files in a bash shell script and using
[ -ot <first xlog in base backup> ] to determine which files to delete.

--
* Greg Smith gsmith@xxxxxxxxxxxxx http://www.gregsmith.com Baltimore, MD


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux