Bug #88788 log_bin is not considered correctly an makes binary logging unusable!
Submitted: 6 Dec 2017 14:29 Modified: 7 Dec 2017 12:02
Reporter: Oli Sennhauser Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Utilities: Binlog Events Severity:S2 (Serious)
Version:5.7.20 OS:Linux (Ubuntu 16.04)
Assigned to: CPU Architecture:Any

[6 Dec 2017 14:29] Oli Sennhauser
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.
[7 Dec 2017 12:02] MySQL Verification Team
Hello Oli,

Thank you for the report and test case.
Imho this is duplicate of Valeriy's Bug #75507.

Thanks,
Umesh
[7 Dec 2017 12:02] MySQL Verification Team
5.7.20 results

Attachment: 88788_5.7.20.results (application/octet-stream, text), 5.89 KiB.