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

Assertion `rw_lock_own(&dict_operation_lock, RW_LOCK_X)' in dict_table_remove_from_cache_low or alike with innodb_evict_tables_on_commit_debug

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (pk INT PRIMARY KEY, a INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1,10),(2,10);
       
      --connect (con1,localhost,root,,test)
      --error ER_DUP_ENTRY
      ALTER TABLE t1 ADD UNIQUE (a), LOCK=SHARED;
      START TRANSACTION;
      INSERT INTO t1 (pk) VALUES (3);
       
      --connection default
      FLUSH TABLES;
      SET @evict.save= @@innodb_evict_tables_on_commit_debug;
      SET GLOBAL innodb_evict_tables_on_commit_debug= 1;
       
      --connection con1
      COMMIT;
       
      # Cleanup
      --disconnect con1
      --connection default
      DROP TABLE t1;
      SET GLOBAL innodb_evict_tables_on_commit_debug= @evict.save;
      

      10.3 bdae8bb6

      mysqld: /data/src/10.3/storage/innobase/dict/dict0dict.cc:1897: void dict_table_remove_from_cache_low(dict_table_t*, ulint): Assertion `rw_lock_own(&dict_operation_lock, RW_LOCK_X)' failed.
      210128 23:48:59 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f09d17f5f36 in __GI___assert_fail (assertion=0x557347183c78 "rw_lock_own(&dict_operation_lock, RW_LOCK_X)", file=0x557347183aa0 "/data/src/10.3/storage/innobase/dict/dict0dict.cc", line=1897, function=0x557347184850 "void dict_table_remove_from_cache_low(dict_table_t*, ulint)") at assert.c:101
      #8  0x0000557346b23af4 in dict_table_remove_from_cache_low (table=0x7f097418f3b0, lru_evict=1) at /data/src/10.3/storage/innobase/dict/dict0dict.cc:1897
      #9  0x0000557346a36e11 in trx_update_mod_tables_timestamp (trx=0x7f09c7400188) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1321
      #10 0x0000557346a375a9 in trx_commit_in_memory (trx=0x7f09c7400188, mtr=0x7f09c6957cc0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1406
      #11 0x0000557346a38a8f in trx_commit_low (trx=0x7f09c7400188, mtr=0x7f09c6957cc0) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1601
      #12 0x0000557346a38b4b in trx_commit (trx=0x7f09c7400188) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1625
      #13 0x0000557346a39031 in trx_commit_for_mysql (trx=0x7f09c7400188) at /data/src/10.3/storage/innobase/trx/trx0trx.cc:1761
      #14 0x00005573467b53df in innobase_commit_low (trx=0x7f09c7400188) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4342
      #15 0x00005573467b57b8 in innobase_commit_ordered_2 (trx=0x7f09c7400188, thd=0x7f0978000d90) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4463
      #16 0x00005573467b5df7 in innobase_commit (hton=0x55734a1f6250, thd=0x7f0978000d90, commit_trx=true) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:4578
      #17 0x00005573465817d2 in commit_one_phase_2 (thd=0x7f0978000d90, all=true, trans=0x7f09780042a8, is_real_trans=true) at /data/src/10.3/sql/handler.cc:1642
      #18 0x00005573465816c1 in ha_commit_one_phase (thd=0x7f0978000d90, all=true) at /data/src/10.3/sql/handler.cc:1622
      #19 0x0000557346580d5a in ha_commit_trans (thd=0x7f0978000d90, all=true) at /data/src/10.3/sql/handler.cc:1484
      #20 0x00005573463e340d in trans_commit (thd=0x7f0978000d90) at /data/src/10.3/sql/transaction.cc:292
      #21 0x000055734625d639 in mysql_execute_command (thd=0x7f0978000d90) at /data/src/10.3/sql/sql_parse.cc:5553
      #22 0x0000557346264b88 in mysql_parse (thd=0x7f0978000d90, rawbuf=0x7f09780116f8 "COMMIT", length=6, parser_state=0x7f09c69595c0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7840
      #23 0x00005573462512ec in dispatch_command (command=COM_QUERY, thd=0x7f0978000d90, packet=0x7f0978008f11 "COMMIT", packet_length=6, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #24 0x000055734624fc8c in do_command (thd=0x7f0978000d90) at /data/src/10.3/sql/sql_parse.cc:1398
      #25 0x00005573463ce295 in do_handle_one_connection (connect=0x55734a505d70) at /data/src/10.3/sql/sql_connect.cc:1403
      #26 0x00005573463cdff1 in handle_one_connection (arg=0x55734a505d70) at /data/src/10.3/sql/sql_connect.cc:1308
      #27 0x0000557346d9a035 in pfs_spawn_thread (arg=0x55734a547000) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #28 0x00007f09d1d05609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #29 0x00007f09d18e1293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4 c2c23e59

      mysqld: /data/src/10.4/storage/innobase/include/dict0dict.h:1534: void dict_sys_t::assert_locked(): Assertion `rw_lock_own(&latch, RW_LOCK_X)' failed.
      210128 23:51:14 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f51200def36 in __GI___assert_fail (assertion=0x564ef02eb698 "rw_lock_own(&latch, RW_LOCK_X)", file=0x564ef02eb638 "/data/src/10.4/storage/innobase/include/dict0dict.h", line=1534, function=0x564ef02eb670 "void dict_sys_t::assert_locked()") at assert.c:101
      #8  0x0000564eef9fe4a0 in dict_sys_t::assert_locked (this=0x564ef0989300 <dict_sys>) at /data/src/10.4/storage/innobase/include/dict0dict.h:1534
      #9  0x0000564eefd0908d in dict_sys_t::remove (this=0x564ef0989300 <dict_sys>, table=0x7f50c41a0e20, lru=true, keep=false) at /data/src/10.4/storage/innobase/dict/dict0dict.cc:1763
      #10 0x0000564eefc1c79f in trx_update_mod_tables_timestamp (trx=0x7f5119d47228) at /data/src/10.4/storage/innobase/trx/trx0trx.cc:1308
      #11 0x0000564eefc21767 in trx_t::commit_in_memory (this=0x7f5119d47228, mtr=0x7f5119256b10) at /data/src/10.4/storage/innobase/trx/trx0trx.cc:1414
      #12 0x0000564eefc1d23b in trx_t::commit_low (this=0x7f5119d47228, mtr=0x7f5119256b10) at /data/src/10.4/storage/innobase/trx/trx0trx.cc:1586
      #13 0x0000564eefc1d2cd in trx_t::commit (this=0x7f5119d47228) at /data/src/10.4/storage/innobase/trx/trx0trx.cc:1600
      #14 0x0000564eefc1d7b3 in trx_commit_for_mysql (trx=0x7f5119d47228) at /data/src/10.4/storage/innobase/trx/trx0trx.cc:1732
      #15 0x0000564eef99b9a5 in innobase_commit_low (trx=0x7f5119d47228) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:4329
      #16 0x0000564eef99bdab in innobase_commit_ordered_2 (trx=0x7f5119d47228, thd=0x7f50c8000d90) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:4458
      #17 0x0000564eef99c3ed in innobase_commit (hton=0x564ef1a01d90, thd=0x7f50c8000d90, commit_trx=true) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:4573
      #18 0x0000564eef7487e9 in commit_one_phase_2 (thd=0x7f50c8000d90, all=true, trans=0x7f50c8004330, is_real_trans=true) at /data/src/10.4/sql/handler.cc:1801
      #19 0x0000564eef7486d8 in ha_commit_one_phase (thd=0x7f50c8000d90, all=true) at /data/src/10.4/sql/handler.cc:1780
      #20 0x0000564eef747920 in ha_commit_trans (thd=0x7f50c8000d90, all=true) at /data/src/10.4/sql/handler.cc:1586
      #21 0x0000564eef57b31c in trans_commit (thd=0x7f50c8000d90) at /data/src/10.4/sql/transaction.cc:236
      #22 0x0000564eef3e0ea3 in mysql_execute_command (thd=0x7f50c8000d90) at /data/src/10.4/sql/sql_parse.cc:5676
      #23 0x0000564eef3e80ab in mysql_parse (thd=0x7f50c8000d90, rawbuf=0x7f50c8012098 "COMMIT", length=6, parser_state=0x7f5119258550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7958
      #24 0x0000564eef3d43d3 in dispatch_command (command=COM_QUERY, thd=0x7f50c8000d90, packet=0x7f50c80087b1 "COMMIT", packet_length=6, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1855
      #25 0x0000564eef3d2c3b in do_command (thd=0x7f50c8000d90) at /data/src/10.4/sql/sql_parse.cc:1373
      #26 0x0000564eef56204b in do_handle_one_connection (connect=0x564ef1d9d600) at /data/src/10.4/sql/sql_connect.cc:1412
      #27 0x0000564eef561d94 in handle_one_connection (arg=0x564ef1d9d600) at /data/src/10.4/sql/sql_connect.cc:1316
      #28 0x0000564eeff8358c in pfs_spawn_thread (arg=0x564ef1ddb920) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #29 0x00007f512095f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #30 0x00007f51201ca293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Not applicable to non-debug builds and to 10.2 due to the use of innodb_evict_tables_on_commit_debug.
      Reproducible on 10.3-10.5.
      On 10.6, the failure stopped happening after this commit:

      commit 1a1b7a6f16c44239655aa8785647f686730e7632
      Author: Marko Mäkelä
      Date:   Fri Nov 20 09:31:27 2020 +0200
       
          MDEV-24167: Replace dict_operation_lock (dict_sys.latch)
      

      I couldn't say however whether it's because the underlying problem was fixed (if there is any underlying problem at all), or just because the commit removed the assertion.

        Attachments

          Activity

            People

            Assignee:
            marko Marko Mäkelä
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration