MySQL Forums
Forum List  »  Backup

binary log index file content after dump
Posted by: Juanito Juanito
Date: November 28, 2014 07:30AM

I'm testing a script that manages the incremental backups generated by mysql. The script does a mysqldump every 24hs and a incremental backup every 2hs. Mysql creates the binary logs (along the binary log index file) on a directory /mysql-log/.



That is every 24hs, it executes something like:

* mysqldump --single-transaction --flush-logs --master-data=2 --routines --delete-master-logs --user=backup_user --password=123456789 <databases> > <somewhere>

where the option --delete-master-logs deletes the binary logs that are no longer needed

What I was expecting is that running this command, the directory /mysql-log/ contained two files:
-rw-rw---- 1 mysql mysql 107 Nov 28 10:54 bin-log.000055
-rw-rw---- 1 mysql mysql 364 Nov 28 10:54 bin-log.index

that is the index file and the newly created binnary log file.

However, the actual content of the /mysql-log/ directory is
-rw-rw---- 1 mysql mysql 148 Nov 28 10:50 bin-log.000051
-rw-rw---- 1 mysql mysql 148 Nov 28 10:51 bin-log.000052
-rw-rw---- 1 mysql mysql 148 Nov 28 10:51 bin-log.000053
-rw-rw---- 1 mysql mysql 148 Nov 28 10:54 bin-log.000054
-rw-rw---- 1 mysql mysql 107 Nov 28 10:54 bin-log.000055
-rw-rw---- 1 mysql mysql 364 Nov 28 10:54 bin-log.index

that is the old binary logs are still available after the dump operation though the dump was done with the --delete-master-logs option.

Moreover, the content of the bin-log.index file is
/mysql-log/bin-log.000042
/mysql-log/bin-log.000043
/mysql-log/bin-log.000044
/mysql-log/bin-log.000045
/mysql-log/bin-log.000046
/mysql-log/bin-log.000047
/mysql-log/bin-log.000048
/mysql-log/bin-log.000049
/mysql-log/bin-log.000050
/mysql-log/bin-log.000051
/mysql-log/bin-log.000052
/mysql-log/bin-log.000053
/mysql-log/bin-log.000054
/mysql-log/bin-log.000055

which does not corresponds to the files in the /mysql-log/ directory.


Any idea what is the issue here?
Thanks

ps: I have tested by running the command

purge binary logs to 'bin-log.000055'

from inside mysql, and then the /mysql-log/ directory contains


-rw-rw---- 1 mysql mysql 107 Nov 28 10:54 bin-log.000055
-rw-rw---- 1 mysql mysql 52 Nov 28 11:28 bin-log.index

Options: ReplyQuote


Subject
Views
Written By
Posted
binary log index file content after dump
3219
November 28, 2014 07:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.