Bug #65150 RPM install fails if gtid-mode=ON in my.cnf
Submitted: 30 Apr 2012 4:06 Modified: 24 Dec 2012 8:27
Reporter: Joffrey MICHAIE Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.6.5m8 OS:Linux (RHEL 6.2 64bits)
Assigned to: CPU Architecture:Any
Tags: Gtid-mode, install

[30 Apr 2012 4:06] Joffrey MICHAIE
Description:
MySQL crashes when installing RPM, with gtid-mode=ON present in /etc/mysql/my.cnf
It fails to install system tables, and prevent further MySQL attempts to start

------ Stdout/Stderr output ------
120430  0:01:37 InnoDB: Waiting for the background threads to start
120430  0:01:37 InnoDB: 1.2.5 started; log sequence number 0
120430  0:01:38 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
120430  0:01:38 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.
120430  0:01:38 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
120430  0:01:38 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.
04:01:38 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=100
thread_count=1
connection_count=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 47920 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x3007de0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f1b382a7e18 thread_stack 0x40000
/usr/sbin/mysqld(my_print_stacktrace+0x35)[0x8920a5]
/usr/sbin/mysqld(handle_fatal_signal+0x4a4)[0x644214]
/lib64/libpthread.so.0(+0xf4a0)[0x7f1b4e5fb4a0]
/usr/sbin/mysqld(_ZN11Group_cache22generate_automatic_gnoEP3THD+0xb4)[0x826974]
/usr/sbin/mysqld(_Z23gtid_before_write_cacheP3THDP17binlog_cache_data+0x22b)[0x84344b]
/usr/sbin/mysqld(_ZN13MYSQL_BIN_LOG11write_eventEP9Log_event+0x54b)[0x84a46b]
/usr/sbin/mysqld(_ZN3THD12binlog_queryENS_22enum_binlog_query_typeEPKcmbbbi+0xb9)[0x84ac49]
/usr/sbin/mysqld(_Z13write_bin_logP3THDbPKcmb+0x5d)[0x71f91d]
/usr/sbin/mysqld(_Z18mysql_create_tableP3THDP10TABLE_LISTP24st_ha_create_informationP10Alter_info+0xf7)[0x726d17]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x44a5)[0x6d8e55]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x30f)[0x6d95df]
/usr/sbin/mysqld[0x6d9e6c]
/usr/sbin/mysqld(_Z19do_handle_bootstrapP3THD+0x14a)[0x6da23a]
/usr/sbin/mysqld(handle_bootstrap+0x47)[0x6da297]
/lib64/libpthread.so.0(+0x77f1)[0x7f1b4e5f37f1]
/lib64/libc.so.6(clone+0x6d)[0x7f1b4d35dccd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f1b2c0009c0): is an invalid pointer
Connection ID (thread ID): 1
Status: NOT_KILLED

---------

Content of /var/lib/mysql :
[root@nowhere~]# ls -l /var/lib/mysql/mysql
total 16
-rw-------. 1 mysql mysql 9582 30 avril 00:01 db.frm
-rw-------. 1 mysql mysql    0 30 avril 00:01 db.MYD
-rw-------. 1 mysql mysql 2048 30 avril 00:01 db.MYI

How to repeat:
1) Create /etc/mysql/my.cnf with following content :
[mysqld]
port		= 3306
socket		= /var/lib/mysql/mysql.sock
skip-external-locking
max_allowed_packet = 16M
max_connections = 100
skip-name-resolve = 1
server-id	= 1
gtid_mode = ON
log_slave_updates = 1
disable-gtid-unsafe-statements = 1
log-bin=mysql-bin
max_binlog_size = 1G
binlog_format=ROW
slave_compressed_protocol = 1
innodb_buffer_pool_size = 64M
innodb_log_file_size = 256M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_file_per_table = 1
innodb_file_format = Barracuda

2) Install RPM :
[root@nowhere ~]# rpm -i MySQL-server-5.6.5_m8-1.el6.x86_64.rpm 

Look at error message displayed, look at content of /var/lib/mysql/mysql/

3) Remove /var/lib/mysql :
[root@nowhere ~]# rm -rf /var/lib/mysql
4) Comment gtid-mode = ON in /etc/mysql/my.cnf
5) Repeat Install, which proceeds successfully then
[30 Apr 2012 8:07] Valeriy Kravchuk
Verified with current mysql-trunk (debug build) on 64-bit FC14. This is what happens when mysql_install_db script is executed:

[openxs@chief trunk]$ scripts/mysql_install_db --no-defaults --log-bin --log-slave-updates --disable-gtid-unsafe-statements --gtid-mode=ON
Installing MySQL system tables...
120430 11:05:32 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=chief-bin' to avoid this problem.
120430 11:05:32 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
120430 11:05:32 InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!
120430 11:05:32 InnoDB: The InnoDB memory heap is disabled
120430 11:05:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120430 11:05:32 InnoDB: Compressed tables use zlib 1.2.5
120430 11:05:32 InnoDB: CPU does not support crc32 instructions
120430 11:05:32 InnoDB: Initializing buffer pool, size = 128.0M
120430 11:05:32 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
120430 11:05:32 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
120430 11:05:32 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
120430 11:05:33 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
120430 11:05:33 InnoDB: Doublewrite buffer not found: creating new
120430 11:05:33 InnoDB: Doublewrite buffer created
120430 11:05:33 InnoDB: 128 rollback segment(s) are active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
120430 11:05:33 InnoDB: 1.2.6 started; log sequence number 0
120430 11:05:34 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
120430 11:05:34 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.
120430 11:05:34 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
120430 11:05:34 [Warning] Error while checking replication metadata. Setting the requested repository in order to give users the chance to fix the problem and restart the server. If this is a live upgrade please consider using mysql_upgrade to fix the problem.
mysqld: /home/openxs/bzr/mysql-trunk-work/sql/rpl_gtid.h:726: Mutex_cond_array::Mutex_cond* Mutex_cond_array::get_mutex_cond(int) const: Assertion `n <= get_max_index()' failed.
08:05:34 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=1
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 68210 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x2d55240
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fdd6429ce58 thread_stack 0x40000
./bin/mysqld(my_print_stacktrace+0x35)[0xacaac9]
./bin/mysqld(handle_fatal_signal+0x404)[0x78c494]
/lib64/libpthread.so.0[0x3ffac0eeb0]
/lib64/libc.so.6(gsignal+0x35)[0x3ffa8330c5]
/lib64/libc.so.6(abort+0x186)[0x3ffa834a76]
/lib64/libc.so.6(__assert_fail+0xf5)[0x3ffa82b905]
./bin/mysqld(_ZNK16Mutex_cond_array14get_mutex_condEi+0x4e)[0xa2d9b0]
./bin/mysqld(_ZNK16Mutex_cond_array16assert_not_ownerEi+0x21)[0xa2d7c9]
./bin/mysqld(_ZNK16Mutex_cond_array4lockEi+0x20)[0xa2d692]
./bin/mysqld(_ZN10Gtid_state10lock_sidnoEi+0x24)[0xa2da4a]
./bin/mysqld(_ZN11Group_cache22generate_automatic_gnoEP3THD+0x139)[0xa2e74b]
./bin/mysqld(_Z23gtid_before_write_cacheP3THDP17binlog_cache_data+0xb3)[0xa5761d]
./bin/mysqld(_ZN13MYSQL_BIN_LOG11write_eventEP9Log_event+0x74b)[0xa609ed]
./bin/mysqld(_ZN3THD12binlog_queryENS_22enum_binlog_query_typeEPKcmbbbi+0x25b)[0xa66825]
./bin/mysqld(_Z13write_bin_logP3THDbPKcmb+0x9e)[0x8bf7a7]
./bin/mysqld(_Z18mysql_create_tableP3THDP10TABLE_LISTP24st_ha_create_informationP10Alter_info+0x1cc)[0x8c6801]
./bin/mysqld(_Z21mysql_execute_commandP3THD+0x19e9)[0x857b94]
./bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x376)[0x860389]
./bin/mysqld[0x852b6e]
./bin/mysqld(_Z19do_handle_bootstrapP3THD+0xb9)[0x852d47]
./bin/mysqld(handle_bootstrap+0x33)[0x852c87]
/lib64/libpthread.so.0[0x3ffac06ccb]
/lib64/libc.so.6(clone+0x6d)[0x3ffa8e0c2d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fdd34000aa0): CREATE TABLE IF NOT EXISTS db (   Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N
Connection ID (thread ID): 1
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

Installation of system tables failed!  Examine the logs in
./data for more information.
...
[24 Dec 2012 8:27] Erlend Dahl
This is a duplicate of an internally filed bug. Fixed in 5.6.6.