Bug #90189 MySQL 5.7 master expire binloglogs results replication interrupt
Submitted: 23 Mar 2018 7:15 Modified: 2 Apr 2018 13:55
Reporter: chen xiaokang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:MySQL 5.7.17 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: expire binlogs results replication interrupt

[23 Mar 2018 7:15] chen xiaokang
Description:
MySQL master:

set expire_logs_days = 30

its binlog :      
           mysql_bin.000003  #30 days ago
           mysql_bin.000004  #new binlog

MySQL master have many days no data to write .

MySQL slave replication;
         replication I/O position "mysql_bin.000003, position 18365907"

master -> slave replication status is ok.

There will be a problem in the following scene:

     ①master -> slave ,slave crash
      
     ②master  ,  begin to write data

mysql_error.log:
2018-03-20T16:30:28.165334+08:00 1038542 [Warning] Timeout waiting for reply of binlog (file: mysql_bin.000004, pos: 1085), semi-sync up to file mysql_bin.000003, position 18365907.
2018-03-20T16:30:28.165363+08:00 1038542 [Note] Semi-sync replication switched OFF.

master do this:

      signal_update();		
      rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);  

     "mysql_bin.000003" was removed more than 30 days later

    ③slave started,replication reoprt a error:

    Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'

      

          

How to repeat:
As shown above

Suggested fix:
Suggest on master set a flag ,when semi-sync binlog to slave fail,don't to purge binlog at semi-sync fail binlog .
[2 Apr 2018 13:55] MySQL Verification Team
Hi,

I don't think this is a bug. It is expected behavior.

best regards
Bogdan