Bug #19421 | MySQL server crashed when deleting from a table | ||
---|---|---|---|
Submitted: | 28 Apr 2006 10:13 | Modified: | 30 May 2006 1:38 |
Reporter: | McEase Tu | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S2 (Serious) |
Version: | 5.1.9/5.1BK | OS: | GNU/Linux 2.6.8-3-686-smp |
Assigned to: | CPU Architecture: | Any |
[28 Apr 2006 10:13]
McEase Tu
[28 Apr 2006 10:17]
McEase Tu
The java program that will lead to the server crash
Attachment: CrashMySQL.java (text/java), 3.76 KiB.
[29 Apr 2006 23:18]
MySQL Verification Team
Thank you for the bug report. I did your test case on Suse Linux 10 and Windows XO and I was unable to repeat with the current source server: miguel@hegel:~/testbug> java CrashMySQL Preparing data... 0 rows inserted into test.tab1 1000 rows inserted into test.tab1 2000 rows inserted into test.tab1 3000 rows inserted into test.tab1 4000 rows inserted into test.tab1 <cut> Thread 54 started Thread 55 started Thread 56 started ^Cmiguel@hegel:~/testbug> miguel@hegel:~/dbs/5.1> bin/mysql -uroot test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.1.10-beta-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> delete from test.tab2; Query OK, 0 rows affected (0.01 sec) mysql> show create table tab2\G *************************** 1. row *************************** Table: tab2 Create Table: CREATE TABLE `tab2` ( `str` varchar(32) DEFAULT NULL, `i` int(11) DEFAULT NULL, `t` datetime DEFAULT NULL, KEY `str` (`str`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY RANGE (UNIX_TIMESTAMP(t)) SUBPARTITION BY KEY (str) SUBPARTITIONS 5 (PARTITION p0 VALUES LESS THAN (1146844800) , PARTITION p1 VALUES LESS THAN (1147449600) , PARTITION p2 VALUES LESS THAN (1148054400) , PARTITION p3 VALUES LESS THAN (1148659200) ) 1 row in set (0.01 sec) mysql> select count(*) from tab1; +----------+ | count(*) | +----------+ | 100000 | +----------+ 1 row in set (0.34 sec) mysql>
[30 Apr 2006 1:14]
McEase Tu
Hi Miguel, Did you termilate the program when all of the threads are still running? At that point it seems hard to cause the server crash. I termilate the program when some of (not all of) the threads end: Preparing data... 0 rows inserted into test.tab1 1000 rows inserted into test.tab1 2000 rows inserted into test.tab1 .... Thread 23 started .... Thread 96 started Thread 97 started Thread 99 started Thread 98 started Thread 3 ended Thread 25 ended ^C <------- Press Ctrl-C when some of the threads end (DONOT wait until all of them end) I also repeated this problem (not sure it's a bug) under windows non-installation version of MySQL 5.1.7. I will be on vacation in next week. But I will still try to keep up with this bug's status. Thanks!
[30 Apr 2006 1:31]
MySQL Verification Team
Hi McEase, Sorry I didn't understand well the the Ctrl+C step. I am going to test again. Thanks for the feedback.
[30 Apr 2006 4:34]
MySQL Verification Team
Thank you for the bug report. c:\mysql\bin>mysqld-nt --standalone --console 060429 22:49:38 InnoDB: Started; log sequence number 0 23549986 060429 22:49:39 [Note] mysqld-nt: ready for connections. Version: '5.1.10-beta' socket: '' port: 3306 Source distribution 060429 23:32:14InnoDB: Assertion failure in thread 3824 in file .\row\row0mysql.c line 1369 InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html InnoDB: about forcing recovery. InnoDB: Thread 1304 stopped in file .\mem\mem0pool.c line 340 InnoDB: Thread 164 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 2812 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 584 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 3880 stopped in file .\os\os0file.c line 2719 InnoDB: Thread 2732 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 3276 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 1388 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 972 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 3284 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 3888 stopped in file .\os\os0sync.c line 309 InnoDB: Thread 2924 stopped in file .\fil\fil0fil.c line 4262 InnoDB: Thread 3236 stopped in file .\sync\sync0arr.c line 130 InnoDB: Thread 2308 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 2308 stopped in file .\os\os0sync.c line 492 InnoDB: Thread 2924 stopped in file .\log\log0log.c line 1483 InnoDB: Thread 3428 stopped in file .\mem\mem0mem.c line 317 InnoDB: Thread 3236 stopped in file .\sync\sync0arr.c line 131 InnoDB: Thread 2812 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 972 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 3284 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 3888 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 3880 stopped in file .\os\os0sync.c line 304 InnoDB: Thread 3276 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 1304 stopped in file .\mem\mem0pool.c line 394 InnoDB: Thread 164 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 1388 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 2732 stopped in file .\os\os0sync.c line 487 InnoDB: Thread 584 stopped in file .\os\os0sync.c line 487 mysql> delete from test.tab2; ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> CALL STACK ON WINDOWS: mysqld-nt.exe!_row_update_for_mysql() + 0x14c C mysqld-nt.exe!_os_fast_mutex_unlock() + 0xb C > mysqld-nt.exe!ha_partition::delete_row(const unsigned char * buf=0x00000004) Line 2732 + 0x18 C++ mysqld-nt.exe!handler::ha_delete_row(const unsigned char * buf=0x04413f10) Line 3331 + 0xf C++ mysqld-nt.exe!mysql_delete(THD * thd=0x00f1e480, st_table_list * table_list=0x00000001, Item * conds=0x00000001, st_sql_list * order=0x00000001, unsigned long limit=0, unsigned __int64 options=0, int reset_auto_increment=0) Line 242 + 0xc C++ mysqld-nt.exe!mysql_execute_command(THD * thd=0x00f1e480) Line 3424 + 0x27 C++ mysqld-nt.exe!mysql_parse(THD * thd=0x02d8f270, char * inBuf=0x00e7cf88, unsigned int length=21) Line 5879 C++ mysqld-nt.exe!dispatch_command(enum_server_command command=COM_QUERY, THD * thd=0x02d8f270, char * packet=0x02d92fb9, unsigned int packet_length=22) Line 1755 C++ mysqld-nt.exe!do_command(THD * thd=0x02d8f270) Line 1539 + 0xd C++ mysqld-nt.exe!handle_one_connection(void * arg=0x02d8f270) Line 1181 + 0xa C++ mysqld-nt.exe!_pthread_start() + 0x3b C mswsock.dll!71a15ccc() mysqld-nt.exe!_threadstart(void * ptd=0x00e74e20) Line 196 + 0x6 C kernel32.dll!7c80b50b() mswsock.dll!71a15ccc() kernel32.dll!7c8399f3() ON LINUX: 060501 1:30:41InnoDB: Assertion failure in thread 1116761008 in file row0mysql.c line 1369 InnoDB: Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html InnoDB: about forcing recovery. InnoDB: Thread 1093684144 stopped in file srv0srv.c line 624 [Thread 1120881584 (zombie) exited] [Thread 1121483696 (zombie) exited] [Thread 1121082288 (zombie) exited] InnoDB: Thread 1120480176 stopped in file ../include/sync0sync.ic line 112 InnoDB: Thread 1120279472 stopped in file ../include/sync0sync.ic line 112 InnoDB: Thread 1120078768 stopped in file ../include/sync0sync.ic line 112 InnoDB: Thread 1118686128 stopped in file ../include/sync0sync.ic line 112 InnoDB: Thread 1118084016 stopped in file ../include/sync0sync.ic line 112 InnoDB: Thread 1117682608 stopped in file ../include/sync0sync.ic line 112 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1116761008 (LWP 2864)] 0x0842f87c in row_update_for_mysql ( mysql_rec=0x92ad640 "ø\tstr 11004", ' ' <repeats 23 times>, "ü*", prebuilt=0x950d2b8) at row0mysql.c:1369 1369 ut_a(node->pcur->rel_pos == BTR_PCUR_ON); Current language: auto; currently c (gdb) bt full #0 0x0842f87c in row_update_for_mysql ( mysql_rec=0x92ad640 "ø\tstr 11004", ' ' <repeats 23 times>, "ü*", prebuilt=0x950d2b8) at row0mysql.c:1369 savept = {least_undo_no = {high = 1116754680, low = 138197822}} err = 155967192 thr = (que_thr_t *) 0x94bded8 <CUT>
[29 May 2006 16:47]
Heikki Tuuri
Miguel, can you still repeat this with the latest 5.1.xx? This might be duplicate of http://bugs.mysql.com/bug.php?id=17992 If you can repeat, please post full stack trace in gdb. Regards, Heikki
[30 May 2006 1:38]
MySQL Verification Team
I was unable to repeat with current source server: Thread 59 ended miguel@hegel:~/testbug> Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 to server version: 5.1.12-beta-debug Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> delete from test.tab2; Query OK, 0 rows affected (0.05 sec) mysql>
[30 May 2006 6:41]
Heikki Tuuri
Miguel, thank you! Bug http://bugs.mysql.com/bug.php?id=17992 can easily explain this bug report, since the trx id field in the record has been garbage, and InnoDB has not known that the record has been inserted by an uncommitted transaction and we should wait for a lock on the record. Regards, Heikki