xiezhenye / mysql-plugin-disable-myisam

MySQL plugin to disable creating MYISAM tables.
GNU General Public License v2.0
25 stars 7 forks source link

Uninstall plugin #5

Closed dynek closed 9 years ago

dynek commented 9 years ago

Hello,

First of all, thank you for the plugin. Nice idea :-)

For some reason, I had to uninstall your plugin but when I do so, connection to mysql is lost .. looks like it's crashing:

mysql> uninstall plugin disable_myisam; ERROR 2013 (HY000): Lost connection to MySQL server during query

Can't really say why, would you happen to have an idea ?

Thank you

dynek commented 9 years ago

Erm, I tried with another plugin provided in percona sources "daemon_example" and the same happens.

xiezhenye commented 9 years ago

It seems you‘ve compiled the plugin with the version or configuration not match with your mysql server. e.g. the -DBUILD_CONFIG=mysql_release configure.

dynek commented 9 years ago

I did use -DBUILD_CONFIG=mysql_release Thing is I didn't build mysql/percona from sources but had it installed via yum on rhel.

xiezhenye commented 9 years ago

Could you provide your MySQL version, and the crash info in the error log?

dynek commented 9 years ago

I provisioned a vagrant box with Percona 5.5.39 - Percona-XtraDB-Cluster-server-55-5.5.39-25.11.824.el6.x86_64

I downloaded percona-server-5.5.39-36.0.tar.gz and did as instructed in your README file and as soon as I do an uninstall plugin:

fn_format: enter: name: ./mysql/plugin  dir:   extension: .MYD  flag: 260
dirname_part: enter: './mysql/plugin'
dirname_part: enter: './mysql/'
cleanup_dirname: enter: from: './mysql/'
fn_format: enter: name: ./mysql/plugin  dir:   extension: .MYI  flag: 260
dirname_part: enter: './mysql/plugin'
dirname_part: enter: './mysql/'
cleanup_dirname: enter: from: './mysql/'
mi_extra: enter: function: 12
mi_extra: enter: function: 5
alloc_root: enter: root: 0x7fc1880083d8
build_table_filename: enter: db: 'mysql'  table_name: 'plugin'  ext: '.TRG'  flags: 0
tablename_to_filename: enter: from 'plugin'
tablename_to_filename: enter: from 'mysql'
mi_extra: enter: function: 45
mi_lock_database: enter: lock_type: 1  old lock 2  r_locks: 0  w_locks: 0 global_changed:  0  open_count: 0  name: './mysql/plugin.MYI'
list_add: enter: root: 0x0  element: 0x7fc188009910
free_root: enter: root: 0x19b1610  flags: 0
08:52:24 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.
Please help us make Percona XtraDB Cluster better by reporting any
bugs at  https://bugs.launchpad.net/percona-xtradb-cluster

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

Thread pointer: 0x19a4a50
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 = 7fc1a41dbd78 thread_stack 0x40000
/usr/sbin/mysqld-debug(my_print_stacktrace+0x35)[0x827722]
/usr/sbin/mysqld-debug(handle_fatal_signal+0x314)[0x6e5b7c]
/lib64/libpthread.so.0[0x3d3680f710]
/usr/sbin/mysqld-debug(_Z22mysql_uninstall_pluginP3THDPK19st_mysql_lex_string+0x47a)[0x5c2f6a]
/usr/sbin/mysqld-debug(_Z21mysql_execute_commandP3THD+0x6b85)[0x5b6b80]
/usr/sbin/mysqld-debug(_Z11mysql_parseP3THDPcjP12Parser_state+0x225)[0x5b6dce]
/usr/sbin/mysqld-debug[0x5b71a2]
/usr/sbin/mysqld-debug(_Z16dispatch_command19enum_server_commandP3THDPcj+0xe2f)[0x5b849c]
/usr/sbin/mysqld-debug(_Z10do_commandP3THD+0x6d5)[0x5ba62e]
/usr/sbin/mysqld-debug(_Z24do_handle_one_connectionP3THD+0x132)[0x667c82]
/usr/sbin/mysqld-debug(handle_one_connection+0x52)[0x667e7d]
/lib64/libpthread.so.0[0x3d368079d1]
/lib64/libc.so.6(clone+0x6d)[0x3d364e886d]

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

You may download the Percona XtraDB Cluster operations manual by visiting
http://www.percona.com/software/percona-xtradb-cluster/. You may find information
in the manual which will help you identify the cause of the crash.                                                                                                                                                                                                                                                                                                  

Thank you for your help

xiezhenye commented 9 years ago

I tried Percona Server 5.5.35-rel33.0, build and install and than uninstall the plugin. Every thing is OK. I noticed that your binary file name is "mysqld-debug". Are you using the debug version?

dynek commented 9 years ago

Yes to be able to print the debug messages. Same thing happen when using the regular binary file.

Anyway forget it, I will just refrain from unloading the module.

rwagnergit commented 9 years ago

I have run into this problem, as well. The problem only occurs if the plugin loads at mysqld startup. For example, the following will cause the error:

INSTALL PLUGIN DISABLE_MYISAM SONAME 'disable_myisam.so'; stop mysqld start mysqld mysql> UNINSTALL PLUGIN DISABLE_MYISAM; ERROR 2013 (HY000): Lost connection to MySQL server during query

However, if we do not restart mysqld between the INSTALL and UNINSTALL, the error does not occur.

rwagnergit commented 9 years ago

Appears to not be specific to this plugin. I opened https://bugs.mysql.com/bug.php?id=77749.

xiezhenye commented 9 years ago

You do not have access to bug #77749. :(

an openned myisam tables after plugin loaded carries a handler point to an ha_myisam_disable_myisam_wrapper which will be unaccessable after the plugin uninstalled and cause crash. While no myisam table is openned before the uninstall operation, crash also occurred because of uninstall operation will access the mysql.plugin table.

I tried to hack the vtable of the handler to restore the origin vtable of ha_myisam to fix the problem.