Bug #59999 mysqlhotcopy returns error and crashes debug server
Submitted: 7 Feb 2011 21:11
Reporter: Sveta Smirnova Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Locking Severity:S3 (Non-critical)
Version:5.5, 5.6.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[7 Feb 2011 21:11] Sveta Smirnova
I believe cause of error is same as in bug #58927.

mysqlhotcopy fails with 

Failed to store master position: DBD::mysql::db do failed: Table 'log_pos' was not locked with LOCK TABLES at ./bin/mysqlhotcopy line 770.

Then debug server crashes with:

mysqld: /users/ssmirnova/blade12/src/mysql-trunk/sql/mdl.cc:1550: bool MDL_context::try_acquire_lock_impl(MDL_request*, MDL_ticket**): Assertion `mdl_request->type != MDL_EXCLUSIVE || is_lock_owner(MDL_key::GLOBAL, "", "", MDL_INTENTION_EXCLUSIVE)' failed.
110207 21:58:54 - 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.

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

Thread pointer: 0xb57f900
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 = 0x496500a0 thread_stack 0x20000

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0xb5d4760): FLUSH TABLES /*!32323 `test`.`u` */
Connection ID (thread ID): 1

How to repeat:
create table u like mysql.user;
create table t1 like mysql.user;
alter table u engine=innodb;
insert into u select * from mysql.user;
insert into t1 select * from mysql.user;

CREATE TABLE log_pos (
      host varchar(60) NOT NULL,
      time_stamp timestamp NOT NULL,
      log_file varchar(32),
      log_pos int(11),
      master_host varchar(60),
      master_log_file varchar(32),
      master_log_pos int(11),
      PRIMARY KEY (host,time_stamp)

Then call mysqlhotcopy:

$./bin/mysqlhotcopy -S /tmp/mysql_ssmirnova.sock -u root --allowold  --record_log_pos=dba.log_pos test./^u/ test2 
Deleting previous 'old' hotcopy directory ('/users/ssmirnova/blade12/build/mysql-trunk/data/test2_old')
Existing hotcopy directory renamed to '/users/ssmirnova/blade12/build/mysql-trunk/data/test2_old'
Locked 1 tables in 0 seconds.
Flushed tables (`test`.`u`) in 0 seconds.
Failed to store master position: DBD::mysql::db do failed: Table 'log_pos' was not locked with LOCK TABLES at ./bin/mysqlhotcopy line 770.

DBD::mysql::db do failed: Lost connection to MySQL server during query at ./bin/mysqlhotcopy line 503.
[1]+  Exit 1                  ./bin/mysqld --defaults-file=support-files/my-small.cnf --basedir=. --datadir=./data --port=33051 --socket=/tmp/mysql_ssmirnova.sock --log-error --log-bin
[7 Feb 2011 22:32] Jon Olav Hauglid
See also Bug#57649