Bug #75252 binlog index corruption with closed stdout
Submitted: 18 Dec 2014 7:18 Modified: 19 Dec 2014 11:04
Reporter: Nilnandan Joshi Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.6.21, 5.6.22, 5.6.30 OS:Any
Assigned to: CPU Architecture:Any

[18 Dec 2014 7:18] Nilnandan Joshi
Description:
binlog index corruption with closed stdout. 

Originally reported here: https://bugs.launchpad.net/percona-server/+bug/1401547

Check more details in "How to repeat"

How to repeat:
[root@centos65 mysql]# /usr/sbin/mysqld --log_bin=test --help --verbose 1>&-
2014-12-18 11:24:40 2527 [Note] Plugin 'FEDERATED' is disabled.
2014-12-18 11:24:40 2527 [Note] Binlog end
2014-12-18 11:24:40 2527 [Note] Shutting down plugin 'CSV'
2014-12-18 11:24:40 2527 [Note] Shutting down plugin 'MyISAM'

[root@centos65 mysql]# ll
total 176268
-rw-rw----. 1 mysql mysql       56 Nov 25 12:58 auto.cnf
-rw-rw----. 1 mysql mysql 79691776 Dec 18 11:24 ibdata1
-rw-rw----. 1 mysql mysql 50331648 Dec 18 11:24 ib_logfile0
-rw-rw----. 1 mysql mysql 50331648 Dec  8 13:43 ib_logfile1
drwx------. 2 mysql mysql     4096 Nov 25 12:59 innodb_memcache
drwx------. 2 mysql mysql     4096 Nov 25 12:58 mysql
drwx------. 2 mysql mysql     4096 Nov 25 12:58 performance_schema
drwx------. 2 mysql mysql     4096 Dec  5 13:39 test
-rw-rw----. 1 root  root    118784 Dec 18 11:24 test.index

[root@centos65 mysql]# cat test.index | more
/usr/sbin/mysqld  Ver 5.6.21-log for Linux on x86_64 (MySQL Community Server (GPL))
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Starts the MySQL database server.

Usage: /usr/sbin/mysqld [OPTIONS]

Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf 
The following groups are read: mysqld server mysqld-5.6
The following options may be given as the first argument:
--print-defaults        Print the program argument list and exit.
--no-defaults           Don't read default options from any option file,
                        except for login file.
--defaults-file=#       Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
--defaults-group-suffix=#
                        Also read groups with concat(group, suffix)
--login-path=#          Read this path from the login file.

  --abort-slave-event-count=# 
                      Option used by mysql-test for debugging and testing of
                      replication.
  --allow-suspicious-udfs 
                      Allows use of UDFs consisting of only one symbol xxx()
                      without corresponding xxx_init() or xxx_deinit(). That
                      also means that one can load any function from any
                      library, for example exit() from libc.so
  -a, --ansi          Use ANSI SQL syntax instead of MySQL syntax. This mode
                      will also set transaction isolation level 'serializable'.
  --archive[=name]    Enable or disable ARCHIVE plugin. Possible values are ON,
                      OFF, FORCE (don't start if the plugin fails to load).
  --auto-increment-increment[=#] 
                      Auto-increment columns are incremented by this

[root@centos65 mysql]#
[19 Dec 2014 11:04] MySQL Verification Team
Hello Nilnandan Joshi,

Thank you for the report.
Observed similar behavior with current Generally Available Release: 5.6.22.

Thanks,
Umesh
[19 Dec 2014 11:06] MySQL Verification Team
// Build details

[root@cluster-repo ~]# rpm -qa|grep mysql-community
mysql-community-libs-compat-5.6.22-2.el6.x86_64
mysql-community-common-5.6.22-2.el6.x86_64
mysql-community-libs-5.6.22-2.el6.x86_64
mysql-community-client-5.6.22-2.el6.x86_64
mysql-community-embedded-5.6.22-2.el6.x86_64
mysql-community-server-5.6.22-2.el6.x86_64
mysql-community-devel-5.6.22-2.el6.x86_64
[root@cluster-repo ~]#
[root@cluster-repo ~]# which mysqld
/usr/sbin/mysqld

//
[root@cluster-repo ~]# /usr/sbin/mysqld --log_bin=bug75252 --help --verbose 1>&-
2014-12-21 18:06:18 11793 [Note] Plugin 'FEDERATED' is disabled.
2014-12-21 18:06:18 11793 [Note] Binlog end
2014-12-21 18:06:18 11793 [Note] Shutting down plugin 'CSV'
2014-12-21 18:06:18 11793 [Note] Shutting down plugin 'MyISAM'

// Confirmed bug75252.index is created in datadir

[root@cluster-repo ~]#
[root@cluster-repo ~]# ls -l /var/lib/mysql/bug75252*
-rw-rw---- 1 mysql mysql 118784 Dec 21 18:06 /var/lib/mysql/bug75252.index

[root@cluster-repo ~]#
[root@cluster-repo ~]# more /var/lib/mysql/bug75252.index
/usr/sbin/mysqld  Ver 5.6.22-log for Linux on x86_64 (MySQL Community Server (GPL))
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Starts the MySQL database server.

Usage: /usr/sbin/mysqld [OPTIONS]
..
..
sysdate-is-now                                             FALSE
table-definition-cache                                     1400
table-open-cache                                           2000
table

// OS details

[root@cluster-repo ~]# cat /etc/*release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Oracle Linux Server release 6.6
Red Hat Enterprise Linux Server release 6.6 (Santiago)
Oracle Linux Server release 6.6
[1 Dec 2017 13:46] MySQL Verification Team
can anybody think of any other files that could get trashed by this? What about if server has it's logs flushed or stdout/stderr closed while it's running?