Bug #35659 Falcon crashes on shutdown after backup+restore+drop DB
Submitted: 28 Mar 2008 20:01 Modified: 23 Oct 2008 11:44
Reporter: Giuseppe Maxia Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:6.0.5 OS:Linux
Assigned to: Jørgen Løland CPU Architecture:Any
Tags: falcon, online backup

[28 Mar 2008 20:01] Giuseppe Maxia
Description:
mysql-6.0 tree - ChangeSet@1.2610, 2008-03-28 11:53:03+01:00

Using the Sakila database, after a backup+restore, an attempt to drop the database will result in an error.

mysql> drop database sakila;
ERROR 1051 (42S02): Unknown table 'country,payment,actor,rental,store,customer,inventory,language,film_category,film,category,address,c'

Furthermore, attempting to shutting down the server will crash.

(from the error log)

080328 21:39:40 [Note] /home/gmax/install/60/sql/mysqld: Normal shutdown

080328 21:39:40 [Note] Event Scheduler: Purging the queue. 0 events
080328 21:39:41 - mysqld got signal 4 ;
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.

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

thd: 0x0
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...
/home/gmax/install/60/sql/mysqld(print_stacktrace+0x21)[0x83f9de2]
/home/gmax/install/60/sql/mysqld(handle_segfault+0x390)[0x82aa854]
[0xffffe420]
/home/gmax/install/60/sql/mysqld(_ZN5Error5errorEPKcz+0x60)[0x84cd33e]
/home/gmax/install/60/sql/mysqld(_ZN5Error15assertionFailedEPKci+0x20)[0x84cd3b0]
/home/gmax/install/60/sql/mysqld(_ZN10SyncObjectD1Ev+0x27)[0x848a391]
/home/gmax/install/60/sql/mysqld(_ZN11TransactionD0Ev+0x184)[0x849b43a]
/home/gmax/install/60/sql/mysqld(_ZN11Transaction7releaseEv+0x2a)[0x8498b48]
/home/gmax/install/60/sql/mysqld(_ZN18TransactionManagerD1Ev+0x3a)[0x85367f0]
/home/gmax/install/60/sql/mysqld(_ZN8DatabaseD0Ev+0x24d)[0x84bcb6d]
/home/gmax/install/60/sql/mysqld(_ZN15StorageDatabase5closeEv+0x36)[0x847fbd2]
/home/gmax/install/60/sql/mysqld(_ZN14StorageHandler15shutdownHandlerEv+0x4b)[0x8482449]
/home/gmax/install/60/sql/mysqld(_ZN16StorageInterface5panicEP10handlerton17ha_panic_function+0x18)[0x8477cfc]
/home/gmax/install/60/sql/mysqld(_Z22ha_finalize_handlertonP13st_plugin_int+0x34)[0x839c17a]
/home/gmax/install/60/sql/mysqld[0x842934d]
/home/gmax/install/60/sql/mysqld[0x842c3b8]
/home/gmax/install/60/sql/mysqld(_Z15plugin_shutdownv+0x156)[0x842cc44]
/home/gmax/install/60/sql/mysqld[0x82a988c]
/home/gmax/install/60/sql/mysqld(kill_server_thread+0x592)[0x82b0260]
/lib/tls/i686/cmov/libpthread.so.0[0xb7f3e46b]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7d4a6de]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

How to repeat:
1) get the Sakila database
   wget http://downloads.mysql.com/docs/sakila-db.tar.gz

2) expand it
   tar -xzf sakila-db.tar.gz

3) change innodb to Falcon
   perl -i -pe 's/innodb/falcon/i' sakila-db/sakila-schema.sql

4) from a mysql client, do the following:
   source sakila-db/sakila-schema_falcon.sql
   source sakila-db/sakila-data_falcon.sql
   show create table actor \G
   # should show 'falcon'
   select count(*) from actor;
   # should show 200
   backup sakila to 'sakila.bkp';
   drop database sakila;
   restore from 'sakila.bkp';
   show create table actor \G
   # should show 'falcon'
   select count(*) from actor;
   # should show 200
   drop database sakila;

   ### error

5) from the command line
   mysqladmin -u root -p shutdown

6) inspect the error log

7) check the core dump

Suggested fix:
N/A
[28 Mar 2008 20:10] Giuseppe Maxia
Added core dump to the FTP server (file: bug_35659-core-dump.tar.bz2 )
[31 Mar 2008 9:17] Giuseppe Maxia
Syntax error.

In  the main description, there is a syntax error. 
It is not 
BACKUP dbname TO "filename"            # WRONG
but 
BACKUP DATABASE dbname TO "filename"   # correct
[31 Mar 2008 10:13] Giuseppe Maxia
Bug reproduced on mysql-6.0-falcon tree, ChangeSet@1.2627, 2008-03-30 15:57:32+02:00
Same behavior.
[31 Mar 2008 18:11] Sveta Smirnova
Thank you for the report.

Verified as described.

For me bug is repeatable with simplier test case:

create table t1(id int) engine=falcon;

insert into t1 values(1);

--eval backup database test to '$MYSQL_TEST_DIR/var/tmp/bug35698.bkp';
[31 Mar 2008 18:42] Kevin Lewis
Lars, after isolating this, if there is anything that you need from Falcon, let us know.
[15 Oct 2008 15:18] Øystein Grøvlen
This seems to be the same as bug#33575
[15 Oct 2008 15:25] Øystein Grøvlen
I was a bit quick here.  It is the assert at shutdown that is similar to bug#33575, but this report also reports another error. (Drop database failure).  This failure looks similar to BUG#34205, but this needs to be investigated.
[23 Oct 2008 11:44] Jørgen Løland
Not repeatable in current backup team tree.