PDA

View Full Version : Purging seemingly not working



czander
September 29th, 2008, 08:07 AM
I'm having problems with mysql-zrm respecting the defined retention policy in mysql-zrm.conf.

I've ran two versions of a purge and always get the same results. It looks like it's doing what it should, reporting no errors, and gets to the last line stating 'purge:INFO: Searching directory /logs/mysql-zrm/dailyrun_shard1/ for Purging' and immediately ends. Details below:


Commands used thus far:

/usr/bin/mysql-zrm-purge --destination /logs/mysql-zrm/dailyrun_shard1/ --verbose --backup-set dailyrun_shard1

/usr/bin/mysql-zrm --action purge --verbose --backup-set dailyrun_shard1


I have a backupset on this particular box named 'dailyrun_shard1'. The following is a list of all the daily snapshots that have been taken. My retention policy is normally 7 days, but for the sake of having to manually remove some files, I've tuned the retention-policy down to three days to use as an example of my problem:

[root@sdcoredb02 dailyrun_shard1]# ls -l /logs/mysql-zrm/dailyrun_shard1/
total 20
drwx------ 2 root root 4096 Sep 25 01:55 20080925013002
drwx------ 2 root root 4096 Sep 26 01:25 20080926010001
drwx------ 2 root root 4096 Sep 27 01:25 20080927010001
drwx------ 2 root root 4096 Sep 28 01:25 20080928010001
drwx------ 2 root root 4096 Sep 29 01:26 20080929010001

As you can see, there are 5 days of backups stored. I run the following command, expecting the purge utility to remove the 2 oldest days, as defined by the 3 day retention policy in /etc/mysql-zrm/dailyrun_shard1/mysql-zrm.conf.


[root@sdcoredb02 dailyrun_shard1]# /usr/bin/mysql-zrm-purge --destination /logs/mysql-zrm/dailyrun_shard1/ --verbose --backup-set dailyrun_shard1
purge:INFO: ZRM for MySQL Community Edition - version 1.2
purge:INFO: Reading options from file /etc/mysql-zrm/mysql-zrm.conf
purge:INFO: Reading options from file /etc/mysql-zrm/dailyrun_shard1/mysql-zrm.conf
purge:INFO: ZRM Temporary configuration file = /etc/mysql-zrm/dailyrun_shard1/tmp3NLFN.conf
purge:INFO: {
purge:INFO: verbose=1
purge:INFO: retention-policy=3D
purge:INFO: tmpdir=/opt
purge:INFO: mysql-binpath=/usr/local/bin
purge:INFO: default-character-set=utf8
purge:INFO: all-databases=1
purge:INFO: destination=/logs/mysql-zrm/dailyrun_shard1
purge:INFO: routines=1
purge:INFO: password=******
purge:INFO: backup-mode=raw
purge:INFO: snapshot-plugin=/usr/share/mysql-zrm/plugins/lvm-snapshot.pl
purge:INFO: compress-plugin=/usr/bin/gzip
purge:INFO: user=backup-db
purge:INFO: backup-level=0
purge:INFO: lvm-snapshot=100M
purge:INFO: mailto=clint@vmix.com
purge:INFO: port=3306
purge:INFO: host=localhost
purge:INFO: socket=/var/lib/mysql/mysql.sock
purge:INFO: html-report-directory=/logs/mysql-zrm/reports
purge:INFO: compress=1
purge:INFO: mysql-binlog-path=/logs
purge:INFO: }
purge:INFO: Searching directory /logs/mysql-zrm/dailyrun_shard1/ for Purging


The problem is that when the process gets to the final line, it immediately exits every time. When I look a the target backup directory I see that no files have been removed.

Can somebody please give me some input as to what I'm doing wrong here. The daily LVM snapshots that I'm taking are fine as I've rebuilt other environments off these backups recently, so I'm confident in the health of the backups. Another thing to note that I'm not sure has any relevance, is that I'm running ZRM version 1.2. Could this be a bug with the version that I'm using? If so, is there any documentation on how to perform an upgrade for zrm community?

Any input would be greatly appreciated.

Thanks

paddy
September 29th, 2008, 11:39 AM
. Another thing to note that I'm not sure has any relevance, is that I'm running ZRM version 1.2. Could this be a bug with the version that I'm using? If so, is there any documentation on how to perform an upgrade for zrm community?


There was a bug in mysql-zrm-purge in 1.2 release and it has been fixed in 2.0. Please try ZRM 2.0.

You can upgrade using rpm -Uvh if you are using rpm packages.

Paddy