[MDEV-502] Assertion `file_entry_buf[2] == 0' failed in deactivate_ddl_log_entry on concurrent REBUILD PARTITION Created: 2012-09-01  Updated: 2013-03-30  Resolved: 2013-03-30

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.0, 5.5.27
Fix Version/s: 10.0.2, 5.5.30

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: upstream


 Description   

Also reproducible on mysql/5.5 and filed as http://bugs.mysql.com/bug.php?id=66645

maria-5.5/sql/sql_table.cc:1320: bool deactivate_ddl_log_entry(uint): Assertion `file_entry_buf[2] == 0' failed.

#6  0x00007f1d7f628235 in __assert_fail () from /lib64/libc.so.6
#7  0x00000000006bd87a in deactivate_ddl_log_entry (entry_no=10)
    at maria-5.5/sql/sql_table.cc:1320
#8  0x0000000000c8c338 in ha_partition::rename_partitions (this=0x7f1d6414daf8,
    path=0x7f1d68c76900 "./test/c") at maria-5.5/sql/ha_partition.cc:874
#9  0x00000000007e20a6 in handler::ha_rename_partitions (this=0x7f1d6414daf8,
    path=0x7f1d68c76900 "./test/c") at maria-5.5/sql/handler.cc:3742
#10 0x0000000000936bb6 in mysql_rename_partitions (lpt=0x7f1d68c76b90)
    at maria-5.5/sql/sql_partition.cc:5556
#11 0x00000000009397e8 in fast_alter_partition_table (thd=0x7f1d64127290, table=0x7f1d64133e50,
    alter_info=0x7f1d68c78e50, create_info=0x7f1d68c78d50, table_list=0x3098090,
    db=0x3098658 "test", table_name=0x3098058 "c", fast_alter_table=0x7f1d64149aa0)
    at maria-5.5/sql/sql_partition.cc:6849
#12 0x00000000006ca80a in mysql_alter_table (thd=0x7f1d64127290, new_db=0x3098658 "test",
    new_name=0x3098058 "c", create_info=0x7f1d68c78d50, table_list=0x3098090,
    alter_info=0x7f1d68c78e50, order_num=0, order=0x0, ignore=false, require_online=false)
    at maria-5.5/sql/sql_table.cc:6607
#13 0x000000000094ce2b in Alter_table_statement::execute (this=0x30986c0, thd=0x7f1d64127290)
    at maria-5.5/sql/sql_alter.cc:106
#14 0x0000000000633889 in mysql_execute_command (thd=0x7f1d64127290)
    at maria-5.5/sql/sql_parse.cc:4459
#15 0x000000000063698f in mysql_parse (thd=0x7f1d64127290,
    rawbuf=0x3097f88 "ALTER TABLE c REBUILD PARTITION p0,p1,p2,p3", length=43,
    parser_state=0x7f1d68c79650) at maria-5.5/sql/sql_parse.cc:5736
#16 0x000000000062a811 in dispatch_command (command=COM_QUERY, thd=0x7f1d64127290,
    packet=0x7f1d6412c611 "ALTER TABLE c REBUILD PARTITION p0,p1,p2,p3", packet_length=43)
    at maria-5.5/sql/sql_parse.cc:1055
#17 0x0000000000629ae4 in do_command (thd=0x7f1d64127290)
    at maria-5.5/sql/sql_parse.cc:794
#18 0x0000000000726f71 in do_handle_one_connection (thd_arg=0x7f1d64127290)
    at maria-5.5/sql/sql_connect.cc:1253
#19 0x0000000000726a34 in handle_one_connection (arg=0x7f1d64127290)
    at maria-5.5/sql/sql_connect.cc:1168
#20 0x00007f1d80938a4f in start_thread () from /lib64/libpthread.so.0
#21 0x00007f1d7f6cd82d in clone () from /lib64/libc.so.6

Some pointers may be invalid and cause the dump to abort.
Query (0x3097f88): ALTER TABLE c REBUILD PARTITION p0,p1,p2,p3
Connection ID (thread ID): 6
Status: NOT_KILLED

maria/5.5
revision-id: psergey@askmonty.org-20120828120322-oc6tznxro84kgkdr
date: 2012-08-28 16:03:22 +0400
build-date: 2012-09-01 19:45:24 +0300
revno: 3513

Also reproducible on 10.0-monty revno 3436, mysql/5.5 revno 3900.
Could not reproduce on maria/5.3, mysql/5.6.

Test case

# If you have a slow(ish) machine, run as 
# perl mysql-test-run.pl --testcase-timeout=60 <testname>
# 
# The procedure is not necessary for the failure,
# it just allows to reproduce it with an MTR test
 
--source include/have_partition.inc
 
--delimiter |
 
CREATE PROCEDURE p ()
BEGIN
  DECLARE attempts INTEGER DEFAULT 10000;
  wl_loop: WHILE attempts > 0 DO
    ALTER TABLE t1 REBUILD PARTITION p0,p1,p2,p3;
    SET attempts = attempts - 1;
  END WHILE wl_loop;
END |
 
--delimiter ;
 
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
 
CREATE TABLE t1 ( `col_int_nokey` INTEGER, `col_int_key` INTEGER NOT NULL, KEY (`col_int_key`) ) ENGINE = MyISAM PARTITION BY LIST ( `col_int_nokey` ) ( PARTITION p0 VALUES IN ( 8, NULL ), PARTITION p1 VALUES IN ( 5, 0, 6 ), PARTITION p2 VALUES IN ( 9, 7, 4 ), PARTITION p3 VALUES IN ( 3, 1, 2 ) );
 
CREATE TABLE t2 ( `col_int_nokey` INTEGER, `col_int_key` INTEGER NOT NULL, KEY (`col_int_key`) ) ENGINE = MyISAM PARTITION BY LIST ( `col_int_nokey` ) ( PARTITION p0 VALUES IN ( 6, NULL ), PARTITION p1 VALUES IN ( 5, 9, 3 ), PARTITION p2 VALUES IN ( 1, 7, 8 ), PARTITION p3 VALUES IN ( 0, 4, 2 ) );
 
--disable_query_log
--connect (con1,localhost,root,,)
--send CALL p()
 
--connect (con2,localhost,root,,)
--let $run = 10000
while ($run)
{
  --echo # $run attempts remain in con2
  ALTER TABLE t2 REBUILD PARTITION p0,p1,p2,p3;
  --dec $run
}
 
--connection con1
--reap
 
--enable_query_log
# Cleanup
DROP TABLE t1, t2;



 Comments   
Comment by Sergei Golubchik [ 2013-01-01 ]

The fix is in the mysql-5.5.30 merge

Comment by Elena Stepanova [ 2013-03-30 ]

The bug was fixed in 5.5.30, although I'm not sure the fix contained a test case (couldn't find the actual commit with the bugfix).

Generated at Thu Feb 08 06:29:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.