codership / mysql-wsrep

wsrep API patch for MySQL server
Other
64 stars 34 forks source link

SIGSEGV on commit with wsrep-on=0 & skip-log-bin. #112

Open nirbhayc opened 9 years ago

nirbhayc commented 9 years ago

How to repeat :: 1) Start a node as a standalone mysql server (no provider, wsrep_on=0). 2) Execute a simple transaction: CREATE TABLE t1(i INT) ENGINE=INNODB; INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);


Program received signal SIGSEGV, Segmentation fault.
0x000000000079d1c8 in thd_get_ha_data (thd=0x1fb40c0, hton=0x17f4a70)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_class.cc:672
672   return *thd_ha_data(thd, hton);
(gdb) bt
#0  0x000000000079d1c8 in thd_get_ha_data (thd=0x1fb40c0, hton=0x17f4a70)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_class.cc:672
#1  0x0000000000a4e16e in thd_binlog_trx_reset (thd=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/binlog.cc:9309
#2  0x00000000008dbb16 in wsrep_cleanup_transaction (thd=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/wsrep_hton.cc:40
#3  0x00000000008dbedf in wsrep_post_commit (thd=0x1fb40c0, all=false)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/wsrep_hton.cc:122
#4  0x00000000008b8764 in trans_commit_stmt (thd=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/transaction.cc:481
#5  0x00000000007f09dc in mysql_execute_command (thd=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_parse.cc:5460
#6  0x00000000007f44f8 in mysql_parse (thd=0x1fb40c0, 
    rawbuf=0x7fffc002c120 "INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8)", length=53, 
    parser_state=0x7fffe3314240) at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_parse.cc:6976
#7  0x00000000007f3a27 in wsrep_mysql_parse (thd=0x1fb40c0, 
    rawbuf=0x7fffc002c120 "INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8)", length=53, 
    parser_state=0x7fffe3314240) at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_parse.cc:6723
#8  0x00000000007e55d3 in dispatch_command (command=COM_QUERY, thd=0x1fb40c0, 
    packet=0x20d4c71 "INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8)", packet_length=53)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_parse.cc:1526
#9  0x00000000007e415a in do_command (thd=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_parse.cc:1115
#10 0x00000000007ad3a6 in do_handle_one_connection (thd_arg=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_connect.cc:1007
#11 0x00000000007aceca in handle_one_connection (arg=0x1fb40c0)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/sql/sql_connect.cc:916
#12 0x0000000000e0c8cf in pfs_spawn_thread (arg=0x2004010)
    at /home/nirbhay/project/git-repo/mysql-wsrep/bld/5.6/storage/perfschema/pfs.cc:1860
#13 0x00007ffff6f4c182 in start_thread (arg=0x7fffe3315700) at pthread_create.c:312
#14 0x00007ffff645947d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

It quite likely because with wsrep_on=0 and explicit binary logging disabled, binlog_hton is not
initialized. But since, wsrep_emulate_binlog=1 (unconditional).. the control tries to access the
binlog hton.

Relates to :: https://github.com/codership/mysql-wsrep/commit/a08296c120cfdf43ea27b8c41aa1376e88a81227

philip-galera commented 9 years ago

I am able to reproduce this . It is specific to setting wsrep-on to 0 or OFF. Not setting the variable at all causes the crash to go away.

philip-galera commented 9 years ago

Not reproducible after starting the server normally and then setting wsrep_on:

mysql> set global wsrep_on=0;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE t1(i INT) ENGINE=INNODB;
Query OK, 0 rows affected (0.05 sec)

mysql> INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
Query OK, 8 rows affected (0.01 sec)
Records: 8  Duplicates: 0  Warnings: 0