Description:
Bad log_bin variable value causes corrupt binary logs and breaks Slave/PiTR.
How to repeat:
[mysqld]
server_id = 42
log_bin = servername.dmz.corp.de_binlog
mysql> show master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------------+----------+--------------+------------------+-------------------+
| servername.dmz.corp | 154 | | | |
+---------------------+----------+--------------+------------------+-------------------+
some dml/ddl
mysql> show master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------------+----------+--------------+------------------+-------------------+
| servername.dmz.corp | 1380 | | | |
+---------------------+----------+--------------+------------------+-------------------+
show binary logs;
+---------------------+-----------+
| Log_name | File_size |
+---------------------+-----------+
| servername.dmz.corp | 1380 |
+---------------------+-----------+
flush binary logs;
Query OK, 0 rows affected (0.03 sec)
root@mysql-5.7 [test] SQL> show master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------------+----------+--------------+------------------+-------------------+
| servername.dmz.corp | 154 | | | |
+---------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
root@mysql-5.7 [test] SQL> show binary logs;
+---------------------+-----------+
| Log_name | File_size |
+---------------------+-----------+
| servername.dmz.corp | 154 |
| servername.dmz.corp | 154 |
+---------------------+-----------+
2 rows in set (0.00 sec)
some binlog events
root@mysql-5.7 [test] SQL> show master status;
+---------------------+----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+---------------------+----------+--------------+------------------+-------------------+
| servername.dmz.corp | 976 | | | |
+---------------------+----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
root@mysql-5.7 [test] SQL> show binary logs;
+---------------------+-----------+
| Log_name | File_size |
+---------------------+-----------+
| servername.dmz.corp | 976 |
| servername.dmz.corp | 976 |
+---------------------+-----------+
2 rows in set (0.00 sec)
mysql@chef:~/database/mysql-5.7/data [mysql-5.7, 3320]> ll servername.*
-rw-r----- 1 mysql mysql 1430 Dec 6 13:56 servername.dmz.corp
-rw-r----- 1 mysql mysql 66 Dec 6 13:56 servername.index
cat servername.index
./servername.dmz.corp
./servername.dmz.corp
./servername.dmz.corp
mysqlbinlog servername.dmz.corp | grep -i -e warn -e err
ERROR: Error in Log_event::read_log_event(): 'Event too small', data_len: 4, event_type: 54
# Warning: this binlog is either in use or was not closed properly.