Bug #82302 rpl.rpl_binlog_errors fails sporadically on windows
Submitted: 21 Jul 2016 6:54 Modified: 16 Dec 2016 14:15
Reporter: João Gramacho Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[21 Jul 2016 6:54] João Gramacho
Description:
The second part of the test case is doing a RESET MASTER to remove all binary log files and generating a single new binary log file. Then, the test case is simulating a binary log issue to make a FLUSH LOGS to not generate a new binary log file. The test case asserts that there is only a single binary log file on the data directory after the FLUSH LOGS.

The assertion is using the following MTR command:
--list_files $MYSQLD_DATADIR *master-bin.0*

On Windows, it is possible that the old binary log cannot be removed promptly and the old file will be renamed to "master-bin.000001.460BC0FD.deleted". The problem is that the "deleted" file name will also match the assertion above described, making the test to fail with the following error:

CURRENT_TEST: rpl.rpl_binlog_errors
...
@@ -25,6 +25,7 @@

 # assert: must show one binlog
 master-bin.000001
+master-bin.000001.460BC0FD.deleted
 include/rpl_restart_server.inc [server_number=1]
 RESET MASTER;
 ###################### TEST #3

mysqltest: Result content mismatch

How to repeat:
Try to access the binary log file before calling the RESET MASTER. 

Suggested fix:
Use a pattern that will not display deleted binary log files on the test case:

diff --git a/mysql-test/suite/rpl/t/rpl_binlog_errors.test b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
index 7122732..24bc46a 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -85,7 +85,7 @@ eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,erro
 -- error ER_NO_UNIQUE_LOGFILE
 FLUSH LOGS;
 -- echo # assert: must show one binlog
---list_files $MYSQLD_DATADIR *master-bin.0*
+--list_files $MYSQLD_DATADIR *master-bin.??????
 
 ### ACTION: clean up and move to next test
 --disable_query_log
[16 Dec 2016 14:15] David Moss
Posted by developer:
 
Thank you for your feedback, this has been fixed in upcoming versions and the following was added to the 5.7.17 and 8.0.1 changelogs:
The rpl.rpl_binlog_errors test was failing sporadically on Windows.