Bug #23843 | MySQL does not restart after crash | ||
---|---|---|---|
Submitted: | 1 Nov 2006 16:02 | Modified: | 23 Nov 2006 12:14 |
Reporter: | Oli Sennhauser | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.0.26 | OS: | Linux (Linux 32-bit) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[1 Nov 2006 16:02]
Oli Sennhauser
[23 Nov 2006 11:40]
Heikki Tuuri
This is probably the same bug as http://bugs.mysql.com/bug.php?id=21468
[23 Nov 2006 11:43]
Heikki Tuuri
I am able to repeat: heikki@127:~/mysql-5.0/sql$ gdb mysqld GNU gdb 6.3-debian Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) run Starting program: /home/heikki/mysql-5.0/sql/mysqld [Thread debugging using libthread_db enabled] [New Thread 1075726944 (LWP 21712)] 061123 13:42:18 [Warning] Changed limits: max_open_files: 1024 max_connections: 1014 table_cache: 64 [New Thread 1129290672 (LWP 21715)] [New Thread 1137679280 (LWP 21716)] [New Thread 1146067888 (LWP 21717)] [New Thread 1154456496 (LWP 21718)] 061123 13:42:19 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... 061123 13:42:19 InnoDB: Starting log scan based on checkpoint at InnoDB: log sequence number 0 189019. InnoDB: Doing recovery: scanned up to log sequence number 0 189019 InnoDB: Transaction 0 2653 was in the XA prepared state. InnoDB: 1 transaction(s) which must be rolled back or cleaned up InnoDB: in total 0 row operations to undo InnoDB: Trx id counter is 0 3072 InnoDB: Last MySQL binlog file position 0 15099, file name ./1.000001 [New Thread 1167625136 (LWP 21719)] [New Thread 1176013744 (LWP 21720)] [New Thread 1184402352 (LWP 21721)] [New Thread 1192790960 (LWP 21722)] 061123 13:42:21 InnoDB: Started; log sequence number 0 189019 InnoDB: Starting in background the rollback of uncommitted transactions 061123 13:42:21 InnoDB: Starting recovery for XA transactions... 061123 13:42:21 InnoDB: Transaction 0 2653 in prepared state after recovery 061123 13:42:21 InnoDB: Transaction contains changes to 1 rows 061123 13:42:21 InnoDB: 1 transactions in prepared state after recovery 061123 13:42:21 [Note] Found 1 prepared transaction(s) in InnoDB 061123 13:42:21 [Note] rollback xid 'MySQLXid\1\0\0\0]\0\0\0\0\0\0\0' Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1075726944 (LWP 21712)] 0x084bc409 in trx_sig_send (trx=0x4224a468, type=1, sender=1, receiver_thr=0x4224f138, savept=0x0, next_thr=0x0) at trx0trx.c:1297 1297 if (trx->sess->state == SESS_ERROR) { Current language: auto; currently c (gdb) bt #0 0x084bc409 in trx_sig_send (trx=0x4224a468, type=1, sender=1, receiver_thr=0x4224f138, savept=0x0, next_thr=0x0) at trx0trx.c:1297 #1 0x084b7ec8 in trx_rollback_step (thr=0x4224f138) at trx0roll.c:1325 #2 0x0847f9a8 in que_thr_step (thr=0x4224f138) at que0que.c:1196 #3 0x0847fa55 in que_run_threads (thr=0x4224f138) at que0que.c:1248 #4 0x084b6120 in trx_general_rollback_for_mysql (trx=0x4224a468, partial=0, savept=0x0) at trx0roll.c:82 #5 0x084b6251 in trx_rollback_for_mysql (trx=0x4224a468) at trx0roll.c:133 #6 0x0830e7f5 in innobase_rollback_trx (trx=0x4224a468) at ha_innodb.cc:1892 #7 0x08316831 in innobase_rollback_by_xid (xid=0x8dfc2b8) at ha_innodb.cc:7259 #8 0x082f7eca in ha_recover (commit_list=0x0) at handler.cc:1050 #9 0x0821621c in init_server_components () at mysqld.cc:3134 #10 0x08216657 in main (argc=1, argv=0xbffffb34) at mysqld.cc:3427 (gdb)
[23 Nov 2006 12:12]
Heikki Tuuri
The bug found: when InnoDB rolled back a prepared transaction in XA recovery, the transaction object did not have an InnoDB 'session' object. That caused a seg fault. Fix: use a dummy session object just like in trx_rollback_all_without_sess() in trx0roll.c.
[23 Nov 2006 12:14]
Heikki Tuuri
I will post the patch to http://bugs.mysql.com/bug.php?id=21468