Bug #48355 Insufficient testing for FLUSH BACKUP LOGS
Submitted: 27 Oct 2009 16:10 Modified: 10 Nov 2009 15:37
Reporter: Ritheesh Vedire Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0-codebase OS:Any
Assigned to: Ritheesh Vedire CPU Architecture:Any
Tags: flush backup logs, testing

[27 Oct 2009 16:10] Ritheesh Vedire
Description:
There are no tests  for  the command FLUSH BACKUP LOGS.

How to repeat:
grep -i 'flush backup logs' suite/backup/t/* 
There are tests where FLUSH BACKUP LOGS has been used, but they don't test the command. 

Suggested fix:
(Fix suggested by Chuck). 

 Main Idea : Use debug sync points to halt the code in the middle of writing to the file.

This will require adding sync point(s) to the log writing method(s) in log.cc and/or logger.cc.
The concept is:

1. set the sync point
2. start a backup operation that will stop in the middle of writing the log
3. dump the log contents
4. call mysqladmin to flush the logs.
5. dump the log contents (should show more data)

Also take ideas  from how tests in the main suite for flushing the query and slow logs were written.
[27 Oct 2009 17:55] Valeriy Kravchuk
What exact version are we talking about? Look:

77-52-222-60:mysql-6.0-codebase openxs$ grep -ri 'flush backup logs' mysql-test/suite/backup/*
mysql-test/suite/backup/r/backup_logs.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/r/backup_logs_output.result:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
mysql-test/suite/backup/t/backup_logs_output.test:FLUSH BACKUP LOGS;
[28 Oct 2009 4:47] Ritheesh Vedire
Yes, you see FLUSH BACKUP LOGS when grepped, but those files do not  effectively  'test' the command. They have been just 'used' in the files. A correct test should ensure that FLUSH BACKUP LOGS works as designed.
In the test files mentioned above , we cannot say whether FLUSH BACKUP LOGS worked or not.
[28 Oct 2009 4:59] Ritheesh Vedire
A CORRECTION in the suggested fix: 

----- STEP 4 -----
replace 'call mysqladmin to flush the logs'  with 'call FLUSH BACKUP LOGS'.