Percona Server 5.5.24 crashes on userstats=1 with any replication configured
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
Fix Released
|
Critical
|
Vlad Lesin | ||
5.5 |
Fix Released
|
Critical
|
Vlad Lesin | ||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
How to repeat:
Setup Master-Master replication on Percona Server 5.5, enable userstats on both instances. Try to create database on both instances and the server will crash
node1:
mysql> show global variables like 'userstat';
+------
| Variable_name | Value |
+------
| userstat | OFF |
+------
1 row in set (0.00 sec)
mysql> set global userstat=1;
Query OK, 0 rows affected (0.00 sec)
mysql> create database db1;
Query OK, 1 row affected (0.00 sec)
mysql> create database db2;
Query OK, 1 row affected (0.00 sec)
mysql> create database db6;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 3
Current database: *** NONE ***
Query OK, 1 row affected (0.00 sec)
node2:
mysql> show global variables like 'userstat';
+------
| Variable_name | Value |
+------
| userstat | OFF |
+------
1 row in set (0.00 sec)
mysql> create database db3;
Query OK, 1 row affected (0.00 sec)
mysql> create database db4;
Query OK, 1 row affected (0.01 sec)
mysql> set global userstat=1;
Query OK, 0 rows affected (0.00 sec)
mysql> create database db5;
Query OK, 1 row affected (0.00 sec)
Stack trace:
Thread pointer: 0x7fb9b0000990
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 = 7fb9c63e7e78 thread_stack 0x40000
/home/user/
/home/user/
/lib64/
/home/user/
/home/user/
/home/user/
/home/user/
/home/user/
/home/user/
/home/user/
/lib64/
/lib64/
Workaround:
Disable userstat on one of the instances (SET GLOBAL userstat=0;)
Related branches
- Alexey Kopytov (community): Approve
-
Diff: 103 lines (+59/-2)6 files modifiedPercona-Server/mysql-test/r/percona_bug1008278.result (+8/-0)
Percona-Server/mysql-test/r/percona_bug1008609.result (+1/-0)
Percona-Server/mysql-test/t/percona_bug1008278-slave.opt (+1/-0)
Percona-Server/mysql-test/t/percona_bug1008278.test (+23/-0)
Percona-Server/mysql-test/t/percona_bug1008609.test (+24/-0)
Percona-Server/sql/sql_connect.cc (+2/-2)
description: | updated |
Changed in percona-server: | |
importance: | Undecided → High |
summary: |
- Percona Server 5.5.24 crashes on Master-Master replication when - userstats are enabled on both instances + Percona Server 5.5.24 crashes on userstats=1 with any replication + configured |
Changed in percona-xtradb-cluster: | |
status: | New → Fix Released |
this bug is repeatable in Percona Server 5.5.24, but can not repeat in Percona Server 5.5.18.
below is the stack
#0 increment_ count_by_ name (name=0xdfb4f0 "#mysql_system#", role_name=0xdfb4f0 "#mysql_system#", users_or_ clients= 0xe4c280, thd=0x3f0bc50) Server- 5.5.24- rel26.0/ sql/sql_ connect. cc:468 global_ user_stats (thd=0x3f0bc50, create_user=true, now=1338860077) Server- 5.5.24- rel26.0/ sql/sql_ connect. cc:668 state=0x4a2933d 0) Server- 5.5.24- rel26.0/ sql/sql_ parse.cc: 5869 event:: do_apply_ event (this=0x3f0f990, rli=0x3ec3c98, query_arg=0x3f0faa9 "create database db27", q_len_arg=20) Server- 5.5.24- rel26.0/ sql/log_ event.cc: 3440 Server- 5.5.24- rel26.0/ sql/log_ event.h: 1136 and_update_ pos (ev=0x3f0f990, thd=<optimized out>, rli=0x3ec3c98) at /tmp/Percona- Server- 5.5.24- rel26.0/ sql/slave. cc:2401 log_event (thd=0x3f0bc50, rli=0x3ec3c98) at /tmp/Percona- Server- 5.5.24- rel26.0/ sql/slave. cc:2561 Server- 5.5.24- rel26.0/ sql/slave. cc:3378 libpthread. so.0
at /tmp/Percona-
#1 0x000000000060eee4 in update_
at /tmp/Percona-
#2 0x00000000005702b5 in mysql_parse (thd=0x3f0bc50, rawbuf=0x3f20ad0 "create database db27", length=66115608, parser_
at /tmp/Percona-
#3 0x0000000000741359 in Query_log_
at /tmp/Percona-
#4 0x0000000000503f3e in apply_event (rli=<optimized out>, this=<optimized out>) at /tmp/Percona-
#5 apply_event_
#6 0x0000000000506527 in exec_relay_
#7 0x000000000050ac34 in handle_slave_sql (arg=<optimized out>) at /tmp/Percona-
#8 0x0000003e638064a7 in start_thread () from /lib64/
#9 0x0000003e630d3c2d in clone () from /lib64/libc.so.6
#10 0x0000000000000000 in ?? ()
(gdb) p thd->net.vio
$4 = (Vio *) 0x0
and in function increment_ count_by_ name, thd->net.vio is used:
542 if (thd->net.vio->type == VIO_TYPE_SSL) stats-> total_ssl_ connections+ +;
543 thread_
544 return 0;
this code can be changed like this: stats-> total_ssl_ connections+ +;
if ( !thd->slave_thread && thd->net.vio->type == VIO_TYPE_SSL)
thread_
because in sql thread, thd->net.vio is always 0x0