[MDEV-12466] Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed in close_thread_tables on FLUSH .. FOR EXPORT with RocksDB table Created: 2017-04-06  Updated: 2018-04-07  Resolved: 2018-04-07

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Storage Engine - RocksDB
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.2.15

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: affects-tests

Issue Links:
Relates
relates to MDEV-13553 Assertion `thd->transaction.stmt.is_e... Closed

 Description   

10.2 ebce682557c34fc6cf

mysqld: /data/src/10.2/sql/sql_base.cc:730: void close_thread_tables(THD*): Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed.
170407  2:13:06 [ERROR] mysqld got signal 6 ;

#7  0x00007f3b838a4312 in __GI___assert_fail (assertion=0x7f3b8699dc18 "thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=0x7f3b8699d9f0 "/data/src/10.2/sql/sql_base.cc", line=730, function=0x7f3b8699f5b0 <close_thread_tables(THD*)::__PRETTY_FUNCTION__> "void close_thread_tables(THD*)") at assert.c:101
#8  0x00007f3b85ed7bc8 in close_thread_tables (thd=0x7f3b18000b00) at /data/src/10.2/sql/sql_base.cc:729
#9  0x00007f3b860c5aab in flush_tables_with_read_lock (thd=0x7f3b18000b00, all_tables=0x7f3b18010f58) at /data/src/10.2/sql/sql_reload.cc:588
#10 0x00007f3b85f51188 in mysql_execute_command (thd=0x7f3b18000b00) at /data/src/10.2/sql/sql_parse.cc:5320
#11 0x00007f3b85f589da in mysql_parse (thd=0x7f3b18000b00, rawbuf=0x7f3b18010e78 "FLUSH TABLE t1 FOR EXPORT", length=25, parser_state=0x7f3b85811260, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7874
#12 0x00007f3b85f46ab2 in dispatch_command (command=COM_QUERY, thd=0x7f3b18000b00, packet=0x7f3b18017fa1 "FLUSH TABLE t1 FOR EXPORT", packet_length=25, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
#13 0x00007f3b85f45422 in do_command (thd=0x7f3b18000b00) at /data/src/10.2/sql/sql_parse.cc:1362
#14 0x00007f3b8608f9e9 in do_handle_one_connection (connect=0x7f3b89175470) at /data/src/10.2/sql/sql_connect.cc:1354
#15 0x00007f3b8608f776 in handle_one_connection (arg=0x7f3b89175470) at /data/src/10.2/sql/sql_connect.cc:1260
#16 0x00007f3b8556e064 in start_thread (arg=0x7f3b85812700) at pthread_create.c:309
#17 0x00007f3b8395e62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

INSTALL SONAME 'ha_rocksdb';
 
CREATE TABLE t1 (i INT) ENGINE=RocksDB;
FLUSH TABLE t1 FOR EXPORT;



 Comments   
Comment by Elena Stepanova [ 2017-08-16 ]

See also MDEV-13553

Comment by Sergei Petrunia [ 2018-04-07 ]

I'm trying on a 10.2 tree that has the fix for MDEV-12553 (the 0a44ae6528d1fdb2d4a9dab1be7e36931eac8236). The testcase for this bug still fails.

Comment by Sergei Petrunia [ 2018-04-07 ]

MyRocks in MariaDB does not have HA_CAN_EXPORT flag. There seems to be some bug on the SQL layer - the assertion fails when we try to close the tables after we have produced an error message.

Comment by Sergei Petrunia [ 2018-04-07 ]

In the upstream, MyRocks doesn't have HA_CAN_EXPORT either.

There is no crash in the upstream, the command produces an error message

MySQL [test]> FLUSH TABLE t1 FOR EXPORT;
ERROR 1031 (HY000): Table storage engine for 't1' doesn't have this option

Generated at Thu Feb 08 07:57:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.