Bug #67256 altering a locked table crashes binlogging mysqlds
Submitted: 16 Oct 2012 8:39 Modified: 13 Aug 2014 11:36
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S2 (Serious)
Version:mysql cluster 7.2.6 OS:Linux
Assigned to: CPU Architecture:Any

[16 Oct 2012 8:39] Hartmut Holzgraefe
Description:
trying to ALTER a cluster table that has been locked with LOCK TABLE on another binlogging mysqld will crash that other mysqld

I know that LOCK TABLE isn't the best idea with cluster as the locks are only local to the current mysqld and not distributed throughout the cluster, but still things should not crash if locks are used ...

Error log will look like this:

121012 13:34:11 [Note] NDB Binlog: logging ./test/t1 (UPDATED,USE_WRITE)
121012 13:35:55 [Note] NDB Binlog: DISCOVER TABLE Event: REPL$test/t1
12:35:55 UTC - mysqld got signal 11 ;
[...]
Thread pointer: 0x7f2e200009b0
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 = 7f2ed80c1ea8 thread_stack 0x20000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x819175]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x6e50b3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f2ef665ccb0]
/usr/local/mysql/bin/mysqld(_Z27ndbcluster_create_event_opsP3THDP9NDB_SHAREPKN13NdbDictionary5TableEPKc+0x1b0)[0x96ad60]
/usr/local/mysql/bin/mysqld(_Z30ndbcluster_create_binlog_setupP3THDP3NdbPKcjS4_S4_P5TABLE+0x232)[0x96f372]
/usr/local/mysql/bin/mysqld(_ZN13ha_ndbcluster6createEPKcP5TABLEP24st_ha_create_information+0x48f)[0x94fe2f]
/usr/local/mysql/bin/mysqld(_Z27ha_create_table_from_engineP3THDPKcS2_+0x1cd)[0x6eb25d]
/usr/local/mysql/bin/mysqld(_Z28ndb_create_table_from_engineP3THDPKcS2_+0x88)[0x951448]
/usr/local/mysql/bin/mysqld(_ZN24Ndb_schema_event_handler27handle_schema_op_post_epochEPNS_13Ndb_schema_opE+0x42c)[0x9753fc]
/usr/local/mysql/bin/mysqld(ndb_binlog_thread_func+0x12e0)[0x971c20]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7f2ef6654e9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f2ef58414bd]

How to repeat:
* Set up a cluster with at least two mysqld nodes
* At least one of the mysqlds needs to have log-bin enabled 
* Create a test table with engine=ndbcluster
* On the binlogging mysqld do a LOCK TABLE on that table
* On the other mysqld do an "ALTER TABLE $table ENGINE=ndb"; (or any other non-online ALTER operation)
* The binlogging mysql will now crash
[8 Nov 2012 5:34] MySQL Verification Team
Hello Hartmut,

Thank you for the report.

Verified as described on reported and later versions.

Thanks,
Umesh
[13 Aug 2014 11:36] Hartmut Holzgraefe
Seems to be fixed, can't reproduce in 7.2.13, 7.3.6 ...?