[MDEV-26087] InnoDB: Failing assertion: table->quiesce == QUIESCE_START upon concurrent FLUSH on view Created: 2021-07-03  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: Views
Affects Version/s: 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.6

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-32749 Failing assertion: table->quiesce == ... Closed
Relates
relates to MDEV-15888 Implement FLUSH TABLES tbl_name [, tb... Closed
relates to MDEV-26086 FTRWL and FLUSH .. FOR EXPORT on TEMP... Open

 Description   

If MDEV-26086 gets fixed, then probably this failure will go away, the second FLUSH will just have to wait on a lock; but if MDEV-26086 is ruled as intentional behavior, then the bug here will need to be fixed.

The test case fails every time for me on current 10.6 debug and release builds, but it involves a race condition, so it's non-deterministic. Run with --repeat if it doesn't fail right away.

--source include/have_innodb.inc
 
CREATE TABLE t (a INT) ENGINE=InnoDB;
CREATE ALGORITHM=TEMPTABLE VIEW v AS SELECT * FROM t;
 
--connect (con1,localhost,root,,test)
--send
FLUSH TABLE v WITH READ LOCK;
--connection default
FLUSH TABLE t FOR EXPORT;
 
# Cleanup
--connection con1
--reap
--disconnect con1
--connection default
UNLOCK TABLES;
DROP VIEW v;
DROP TABLE t;

10.6 59bc063d

2021-07-03 18:40:05 0x7f6c63dff700  InnoDB: Assertion failure in file /data/src/10.6/storage/innobase/row/row0quiesce.cc line 689
InnoDB: Failing assertion: table->quiesce == QUIESCE_START
 
#6  0x0000560a1e54b748 in ut_dbg_assertion_failed (expr=0x560a1ec36198 "table->quiesce == QUIESCE_START", file=0x560a1ec35c48 "/data/src/10.6/storage/innobase/row/row0quiesce.cc", line=689) at /data/src/10.6/storage/innobase/ut/ut0dbg.cc:60
#7  0x0000560a1e4ecf50 in row_quiesce_set_state (table=0x7f6c34101498, state=QUIESCE_COMPLETE, trx=0x7f6c690ce1e0) at /data/src/10.6/storage/innobase/row/row0quiesce.cc:689
#8  0x0000560a1e4ec88e in row_quiesce_table_start (table=0x7f6c34101498, trx=0x7f6c690ce1e0) at /data/src/10.6/storage/innobase/row/row0quiesce.cc:563
#9  0x0000560a1e2e6496 in ha_innobase::external_lock (this=0x7f6c342383a0, thd=0x7f6c34000db8, lock_type=0) at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:15726
#10 0x0000560a1de6e35e in handler::ha_external_lock (this=0x7f6c342383a0, thd=0x7f6c34000db8, lock_type=0) at /data/src/10.6/sql/handler.cc:7026
#11 0x0000560a1dfb7a51 in lock_external (thd=0x7f6c34000db8, tables=0x7f6c34239568, count=1) at /data/src/10.6/sql/lock.cc:393
#12 0x0000560a1dfb76f8 in mysql_lock_tables (thd=0x7f6c34000db8, sql_lock=0x7f6c34239548, flags=4096) at /data/src/10.6/sql/lock.cc:338
#13 0x0000560a1dfb75ac in mysql_lock_tables (thd=0x7f6c34000db8, tables=0x7f6c34015d70, count=1, flags=4096) at /data/src/10.6/sql/lock.cc:301
#14 0x0000560a1da19fea in lock_tables (thd=0x7f6c34000db8, tables=0x7f6c34015688, count=1, flags=4096) at /data/src/10.6/sql/sql_base.cc:5549
#15 0x0000560a1da194da in open_and_lock_tables (thd=0x7f6c34000db8, options=..., tables=0x7f6c34015688, derived=false, flags=4096, prelocking_strategy=0x7f6c63dfdcf8) at /data/src/10.6/sql/sql_base.cc:5261
#16 0x0000560a1dcbed70 in open_and_lock_tables (thd=0x7f6c34000db8, tables=0x7f6c34015688, derived=false, flags=4096, prelocking_strategy=0x7f6c63dfdcf8) at /data/src/10.6/sql/sql_base.h:278
#17 0x0000560a1dcbff1c in flush_tables_with_read_lock (thd=0x7f6c34000db8, all_tables=0x7f6c34015688) at /data/src/10.6/sql/sql_reload.cc:585
#18 0x0000560a1dac8709 in mysql_execute_command (thd=0x7f6c34000db8, is_called_from_prepared_stmt=false) at /data/src/10.6/sql/sql_parse.cc:5407
#19 0x0000560a1dad0a85 in mysql_parse (thd=0x7f6c34000db8, rawbuf=0x7f6c340155c0 "FLUSH TABLE t FOR EXPORT", length=24, parser_state=0x7f6c63dfe480) at /data/src/10.6/sql/sql_parse.cc:8026
#20 0x0000560a1dabceed in dispatch_command (command=COM_QUERY, thd=0x7f6c34000db8, packet=0x7f6c3400b879 "FLUSH TABLE t FOR EXPORT", packet_length=24, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1896
#21 0x0000560a1dabb889 in do_command (thd=0x7f6c34000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1404
#22 0x0000560a1dc78d9b in do_handle_one_connection (connect=0x560a21485048, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1410
#23 0x0000560a1dc78af7 in handle_one_connection (arg=0x560a21484ab8) at /data/src/10.6/sql/sql_connect.cc:1312
#24 0x0000560a1e1e8c1b in pfs_spawn_thread (arg=0x560a21484b98) at /data/src/10.6/storage/perfschema/pfs.cc:2201
#25 0x00007f6c6f0f4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#26 0x00007f6c6ecc7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Reproducible on 10.6, debug- and non-debug builds, with temptable views. Same observations as in MDEV-26086 apply.



 Comments   
Comment by Elena Stepanova [ 2021-07-03 ]

Assigned to serg as related to MDEV-26086.

Comment by Alice Sherepa [ 2022-07-15 ]

similar, on 10.10:

2022-07-15 12:51:48 0x7efc2c3a6700  InnoDB: Assertion failure in file /10.10/storage/innobase/row/row0quiesce.cc line 683
InnoDB: Failing assertion: table->quiesce == QUIESCE_START
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mariadbd startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
InnoDB: about forcing recovery.
220715 12:51:48 [ERROR] mysqld got signal 6 ;
 
Server version: 10.10.0-MariaDB-log
 
linux/raise.c:51(__GI_raise)[0x7efc519187bb]
stdlib/abort.c:81(__GI_abort)[0x7efc51903535]
ut/ut0rbt.cc:471(rbt_eject_node(ib_rbt_node_t*, ib_rbt_node_t*) [clone .cold.36])[0x56036df9d524]
row/row0quiesce.cc:509(row_quiesce_table_start(dict_table_t*, trx_t*))[0x56036df960ca]
row/row0quiesce.cc:560(row_quiesce_table_start(dict_table_t*, trx_t*))[0x56036df9635d]
handler/ha_innodb.cc:15975(ha_innobase::external_lock(THD*, int))[0x56036e5bb896]
sql/handler.cc:7077(handler::ha_external_lock(THD*, int))[0x56036e32bcac]
sql/lock.cc:393(lock_external)[0x56036e417ed4]
sql/lock.cc:301(mysql_lock_tables(THD*, TABLE**, unsigned int, unsigned int))[0x56036e418abb]
sql/sql_base.cc:5796(lock_tables(THD*, TABLE_LIST*, unsigned int, unsigned int))[0x56036e08ec5f]
sql/sql_base.cc:5556(open_and_lock_tables(THD*, DDL_options_st const&, TABLE_LIST*, bool, unsigned int, Prelocking_strategy*))[0x56036e0903f2]
sql/sql_reload.cc:585(flush_tables_with_read_lock(THD*, TABLE_LIST*))[0x56036e21ae43]
sql/sql_parse.cc:5411(mysql_execute_command(THD*, bool))[0x56036e0fced6]
sql/sql_parse.cc:8053(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x56036e0ec3fc]
sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x56036e0f6d1c]
sql/sql_parse.cc:1407(do_command(THD*, bool))[0x56036e0f83c6]
sql/sql_connect.cc:1418(do_handle_one_connection(CONNECT*, bool))[0x56036e1fdd9f]
sql/sql_connect.cc:1312(handle_one_connection)[0x56036e1fe0dd]
perfschema/pfs.cc:2204(pfs_spawn_thread)[0x56036e5247d5]
nptl/pthread_create.c:487(start_thread)[0x7efc51dcefa3]
x86_64/clone.S:97(clone)[0x7efc519d9eff]

Generated at Thu Feb 08 09:42:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.