Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36097

InnoDB: Failing assertion: t->id != table->id in hash_cell_t::search

Details

    Description

      CS 11.4.6 ef966af801afc2a07222b5df65dddd52c77431dd (Optimized) Build 15/02/2025

      InnoDB: Failing assertion: t->id != table->id
      

      CS 11.4.6 ef966af801afc2a07222b5df65dddd52c77431dd (Optimized) Build 15/02/2025

      Core was generated by `/test/MD150225-mariadb-11.4.6-linux-x86_64-opt/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 57378)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000014cbb8a4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000014cbb8a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000055c6ef177506 in ut_dbg_assertion_failed (expr=0x55c6efc9d2a4 "t->id != table->id", file=0x55c6efc9cc25 "/test/11.4_opt/storage/innobase/dict/dict0dict.cc", line=line@entry=1201) at /test/11.4_opt/storage/innobase/ut/ut0dbg.cc:60
      #6  0x000055c6ef92e28a in dict_sys_t::add(dict_table_t*)::{lambda(dict_table_t const*)#2}::operator()(dict_table_t const*) const (t=<optimized out>, this=<optimized out>)at /test/11.4_opt/storage/innobase/dict/dict0dict.cc:1201
      #7  hash_cell_t::search<dict_table_t, dict_sys_t::add(dict_table_t*)::{lambda(dict_table_t const*)#2}>(dict_table_t* dict_table_t::*, dict_sys_t::add(dict_table_t*)::{lambda(dict_table_t const*)#2}) (next=&dict_table_t::id_hash, u={table = 0x14cb540536c0}, this=<optimized out>) at include/hash0hash.h:89
      #8  dict_sys_t::add (this=0x55c6f04da580 <dict_sys>, table=0x14cb540536c0)at /test/11.4_opt/storage/innobase/dict/dict0dict.cc:1197
      #9  0x000055c6ef93260d in dict_load_table_one (name=@0x14cbb1766f80: {data_ = 0x14cbb1767240 "test/t1#P#p10", size_ = 13}, ignore_err=ignore_err@entry=DICT_ERR_IGNORE_FK_NOKEY, fk_tables=std::deque with 0 elements)at /test/11.4_opt/storage/innobase/dict/dict0load.cc:2416
      #10 0x000055c6ef9311d7 in dict_sys_t::load_table (this=0x55c6f04da580 <dict_sys>, name=@0x14cbb1766f80: {data_ = 0x14cbb1767240 "test/t1#P#p10", size_ = 13}, ignore=DICT_ERR_IGNORE_FK_NOKEY)at /test/11.4_opt/storage/innobase/dict/dict0load.cc:2550
      #11 0x000055c6ef924fa5 in dict_table_open_on_name (table_name=table_name@entry=0x14cbb1767240 "test/t1#P#p10", dict_locked=false, ignore_err=ignore_err@entry=DICT_ERR_IGNORE_FK_NOKEY)at /test/11.4_opt/storage/innobase/dict/dict0dict.cc:1108
      #12 0x000055c6ef7ddf64 in ha_innobase::open_dict_table (norm_name=0x14cbb1767240 "test/t1#P#p10", ignore_err=DICT_ERR_IGNORE_FK_NOKEY, is_partition=<optimized out>)at /test/11.4_opt/storage/innobase/handler/ha_innodb.cc:6139
      #13 ha_innobase::open (this=0x14cb542a1dc8, name=0x14cbb1767570 "./test/t1#P#p10")at /test/11.4_opt/storage/innobase/handler/ha_innodb.cc:5844
      #14 0x000055c6ef524d56 in handler::ha_open (this=0x14cb542a1dc8, table_arg=<optimized out>, name=0x14cbb1767570 "./test/t1#P#p10", mode=2, test_if_locked=1042, mem_root=0x0, partitions_to_open=0x0)at /test/11.4_opt/sql/handler.cc:3592
      #15 0x000055c6ef745faf in ha_partition::open_read_partitions (this=this@entry=0x14cb54260d58, name_buff=name_buff@entry=0x14cbb1767570 "./test/t1#P#p10", name_buff_size=name_buff_size@entry=513)at /test/11.4_opt/sql/ha_partition.cc:8931
      #16 0x000055c6ef745b19 in ha_partition::open (this=0x14cb54260d58, name=0x14cb542656c0 "./test/t1", mode=<optimized out>, test_if_locked=<optimized out>) at /test/11.4_opt/sql/ha_partition.cc:3920
      #17 0x000055c6ef524d56 in handler::ha_open (this=0x14cb54260d58, table_arg=<optimized out>, name=0x14cb542656c0 "./test/t1", mode=2, test_if_locked=18, mem_root=0x0, partitions_to_open=0x0)at /test/11.4_opt/sql/handler.cc:3592
      #18 0x000055c6ef3b00ad in open_table_from_share (thd=thd@entry=0x14cb54000c68, share=share@entry=0x14cb542651c0, alias=alias@entry=0x14cb54018548, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=0x14cb54240c38, is_create_table=<optimized out>, partitions_to_open=0x0)at /test/11.4_opt/sql/table.cc:4611
      #19 0x000055c6ef250d46 in open_table (thd=0x14cb54000c68, table_list=table_list@entry=0x14cb54018500, ot_ctx=ot_ctx@entry=0x14cbb1767ba0) at /test/11.4_opt/sql/sql_base.cc:2263
      #20 0x000055c6ef253b17 in open_and_process_table (thd=0x14cb54000c68, tables=0x14cb54018500, counter=0x14cbb1767e4c, flags=0, prelocking_strategy=0x14cbb1768070, ot_ctx=0x14cbb1767ba0, has_prelocking_list=<optimized out>) at /test/11.4_opt/sql/sql_base.cc:4196
      #21 open_tables (thd=thd@entry=0x14cb54000c68, options=@0x14cb540064d0: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x14cbb1767e40, counter=counter@entry=0x14cbb1767e4c, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14cbb1768070)at /test/11.4_opt/sql/sql_base.cc:4682
      #22 0x000055c6ef255454 in open_and_lock_tables (thd=0xd7f5, thd@entry=0x14cb54000c68, options=<error reading variable: Cannot access memory at address 0xe022>, tables=0x14cb54017418, derived=true, flags=398, flags@entry=0, prelocking_strategy=0x0, prelocking_strategy@entry=0x14cbb1768070)at /test/11.4_opt/sql/sql_base.cc:5656
      #23 0x000055c6ef2c3cdc in open_and_lock_tables (thd=0x14cb54000c68, tables=0x6, derived=true, flags=0) at /test/11.4_opt/sql/sql_base.h:532
      #24 mysql_execute_command (thd=thd@entry=0x14cb54000c68, is_called_from_prepared_stmt=<optimized out>)at /test/11.4_opt/sql/sql_parse.cc:4573
      #25 0x000055c6ef2bc7e1 in mysql_parse (thd=thd@entry=0x14cb54000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14cbb1768490)at /test/11.4_opt/sql/sql_parse.cc:7907
      #26 0x000055c6ef2bac99 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14cb54000c68, packet=packet@entry=0x14cb540087e9 "INSERT INTO t1(g) SELECT ST_GeomFromWKB(ST_AsBinary(g)) FROM t1 ORDER BY pk", packet_length=packet_length@entry=75, blocking=true) at /test/11.4_opt/sql/sql_parse.cc:1904
      #27 0x000055c6ef2bcbf1 in do_command (thd=thd@entry=0x14cb54000c68, blocking=true) at /test/11.4_opt/sql/sql_parse.cc:1417
      #28 0x000055c6ef3e479d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c6f3542c08, put_in_cache=true)at /test/11.4_opt/sql/sql_connect.cc:1408
      #29 0x000055c6ef3e4563 in handle_one_connection (arg=arg@entry=0x55c6f3542c08)at /test/11.4_opt/sql/sql_connect.cc:1320
      #30 0x000055c6ef753a4e in pfs_spawn_thread (arg=0x55c6f34ef758)at /test/11.4_opt/storage/perfschema/pfs.cc:2201
      #31 0x000014cbb8a9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #32 0x000014cbb8b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      I am working on a testcase

      Attachments

        Issue Links

          Activity

            Roel Roel Van de Paar added a comment - - edited

            Preliminary testcase (sporadic)

            SET sql_mode='';
            SET GLOBAL query_cache_type=DEMAND;
            create TABLE t1(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=RocksDB;
            explain select * FROM t1  s00, t1 s01, t1 s02, t1 s03, t1 s04,t1 s05,t1 s06,t1 s07,t1 s08,t1 s09, t1 s10, t1 s11, t1 s12, t1 s13, t1 s14,t1 s15,t1 s16,t1 s17,t1 s18,t1 s19, t1 s20, t1 s21, t1 s22, t1 s23, t1 s24,t1 s25,t1 s26,t1 s27,t1 s28,t1 s29, t1 s30, t1 s31, t1 s32, t1 s33, t1 s34,t1 s35,t1 s36,t1 s37,t1 s38,t1 s39, t1 s40, t1 s41, t1 s42, t1 s43, t1 s44,t1 s45,t1 s46,t1 s47,t1 s48,t1 s49 where s00.a in ( select m00.a FROM t1  m00, t1 m01, t1 m02, t1 m03, t1 m04,t1 m05,t1 m06,t1 m07,t1 m08,t1 m09, t1 m10, t1 m11, t1 m12, t1 m13, t1 m14,t1 m15,t1 m16,t1 m17,t1 m18,t1 t1 );
            ALTER DATABASE d10 COLLATE utf8_spanish2_ci;
            create definer=`test14256`@`%` view v1 as select 42;
            show create function f5;
            set global query_cache_size= 81920;
            SET SESSION query_cache_type = 1;
            DROP TABLE t1;
            CREATE TABLE t1 (c1 INT NOT NULL, c2 CHAR(5)) PARTITION BY LINEAR KEY(c1) PARTITIONS 99;
            SELECT * FROM t1  WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2;
            SELECT COUNT(*) FROM t1 ;
            select C.a, c.a FROM t1  c, t1 C;
            SELECT a FROM t1  WHERE a < ANY (SELECT a FROM t1  WHERE b = 2 UNION SELECT a FROM t1  WHERE b = 2);
            

            Roel Roel Van de Paar added a comment - - edited Preliminary testcase (sporadic) SET sql_mode= '' ; SET GLOBAL query_cache_type=DEMAND; create TABLE t1(i1 int not null auto_increment, a int , b int , primary key (i1)) engine=RocksDB; explain select * FROM t1 s00, t1 s01, t1 s02, t1 s03, t1 s04,t1 s05,t1 s06,t1 s07,t1 s08,t1 s09, t1 s10, t1 s11, t1 s12, t1 s13, t1 s14,t1 s15,t1 s16,t1 s17,t1 s18,t1 s19, t1 s20, t1 s21, t1 s22, t1 s23, t1 s24,t1 s25,t1 s26,t1 s27,t1 s28,t1 s29, t1 s30, t1 s31, t1 s32, t1 s33, t1 s34,t1 s35,t1 s36,t1 s37,t1 s38,t1 s39, t1 s40, t1 s41, t1 s42, t1 s43, t1 s44,t1 s45,t1 s46,t1 s47,t1 s48,t1 s49 where s00.a in ( select m00.a FROM t1 m00, t1 m01, t1 m02, t1 m03, t1 m04,t1 m05,t1 m06,t1 m07,t1 m08,t1 m09, t1 m10, t1 m11, t1 m12, t1 m13, t1 m14,t1 m15,t1 m16,t1 m17,t1 m18,t1 t1 ); ALTER DATABASE d10 COLLATE utf8_spanish2_ci; create definer=`test14256`@`%` view v1 as select 42; show create function f5; set global query_cache_size= 81920; SET SESSION query_cache_type = 1; DROP TABLE t1; CREATE TABLE t1 (c1 INT NOT NULL , c2 CHAR (5)) PARTITION BY LINEAR KEY (c1) PARTITIONS 99; SELECT * FROM t1 WHERE c1 <= '1998-12-29 00:00:00' ORDER BY c1,c2; SELECT COUNT (*) FROM t1 ; select C.a, c.a FROM t1 c, t1 C; SELECT a FROM t1 WHERE a < ANY ( SELECT a FROM t1 WHERE b = 2 UNION SELECT a FROM t1 WHERE b = 2);

            As far as I can tell, the addition or removal of tables in dict_sys.table_id_hash should be protected by an exclusive dict_sys.latch. It is not clear what would be causing a duplicate table entry.

            I see that the test case makes use of the query cache as well as engine=rocksdb. I think that for analyzing and fixing this, I’d need an rr replay trace that leads to the reported failure.

            marko Marko Mäkelä added a comment - As far as I can tell, the addition or removal of tables in dict_sys.table_id_hash should be protected by an exclusive dict_sys.latch . It is not clear what would be causing a duplicate table entry. I see that the test case makes use of the query cache as well as engine=rocksdb . I think that for analyzing and fixing this, I’d need an rr replay trace that leads to the reported failure.

            MDEV-23256 Is related, and keeps getting in the way of this sporadic issue.

            Roel Roel Van de Paar added a comment - MDEV-23256 Is related, and keeps getting in the way of this sporadic issue.

            Reproduced the issue under rr, however back traces are not showing correctly in rr replay. Discussing with marko

            Roel Roel Van de Paar added a comment - Reproduced the issue under rr , however back traces are not showing correctly in rr replay . Discussing with marko

            People

              Roel Roel Van de Paar
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.