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

InnoDB: Failing assertion: lock->lock_word.load(std::memory_order_relaxed) == X_LOCK_DECR upon server shutdown

    XMLWordPrintable

    Details

      Description

      10.4 2cff807d

      2020-01-03 14:39:50 0x7f9534216700  InnoDB: Assertion failure in file /data/src/10.4/storage/innobase/sync/sync0rw.cc line 255
      InnoDB: Failing assertion: lock->lock_word.load(std::memory_order_relaxed) == X_LOCK_DECR
       
      Query (0x7f94c0011d68): ALTER TABLE t1 CHANGE IF EXISTS b a INT, ALGORITHM=COPY /* QNO 169 CON_ID 12 */
      Connection ID (thread ID): 12
      Status: KILL_SERVER
      

      #6  0x00005653d0678a6a in ut_dbg_assertion_failed (expr=0x5653d0e03f18 "lock->lock_word.load(std::memory_order_relaxed) == X_LOCK_DECR", file=0x5653d0e03e90 "/data/src/10.4/storage/innobase/sync/sync0rw.cc", line=255) at /data/src/10.4/storage/innobase/ut/ut0dbg.cc:60
      #7  0x00005653d061c65f in rw_lock_free_func (lock=0x7f94c00b1e18) at /data/src/10.4/storage/innobase/sync/sync0rw.cc:255
      #8  0x00005653d07d3a7e in pfs_rw_lock_free_func (lock=0x7f94c00b1e18) at /data/src/10.4/storage/innobase/include/sync0rw.ic:617
      #9  0x00005653d07d7d89 in fts_cache_destroy (cache=0x7f94c00b1e18) at /data/src/10.4/storage/innobase/fts/fts0fts.cc:287
      #10 0x00005653d07e2fb4 in fts_t::~fts_t (this=0x7f94c00844d8, __in_chrg=<optimized out>) at /data/src/10.4/storage/innobase/fts/fts0fts.cc:5349
      #11 0x00005653d07e3094 in fts_free (table=0x7f94c043d0a8) at /data/src/10.4/storage/innobase/fts/fts0fts.cc:5386
      #12 0x00005653d059a3e4 in row_drop_ancillary_fts_tables (table=0x7f94c043d0a8, trx=0x7f95218e4830) at /data/src/10.4/storage/innobase/row/row0mysql.cc:3248
      #13 0x00005653d059b7fb in row_drop_table_for_mysql (name=0x7f9534210e80 "test/#sql-73c7_c", trx=0x7f95218e4830, sqlcom=SQLCOM_ALTER_TABLE, create_failed=false, nonatomic=true) at /data/src/10.4/storage/innobase/row/row0mysql.cc:3728
      #14 0x00005653d0413245 in ha_innobase::delete_table (this=0x7f94c0013a10, name=0x7f94c00c7058 "./test/#sql-73c7_c", sqlcom=SQLCOM_ALTER_TABLE) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:13184
      #15 0x00005653d03fc780 in ha_innobase::delete_table (this=0x7f94c0013a10, name=0x7f94c00c7058 "./test/#sql-73c7_c") at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:13309
      #16 0x00005653d01aed5c in handler::ha_delete_table (this=0x7f94c0013a10, name=0x7f94c00c7058 "./test/#sql-73c7_c") at /data/src/10.4/sql/handler.cc:4695
      #17 0x00005653d00d3783 in THD::rm_temporary_table (this=0x7f94c0000af0, base=0x5653d284a5c0, path=0x7f94c00c7058 "./test/#sql-73c7_c") at /data/src/10.4/sql/temporary_tables.cc:701
      #18 0x00005653d00d5663 in THD::free_tmp_table_share (this=0x7f94c0000af0, share=0x7f94c00c6ac0, delete_table=true) at /data/src/10.4/sql/temporary_tables.cc:1464
      #19 0x00005653d00d35bb in THD::drop_temporary_table (this=0x7f94c0000af0, table=0x7f94c043aa80, is_trans=0x0, delete_table=true) at /data/src/10.4/sql/temporary_tables.cc:664
      #20 0x00005653cff3810b in mysql_alter_table (thd=0x7f94c0000af0, new_db=0x7f94c00052b0, new_name=0x7f94c00056b8, create_info=0x7f9534213d40, table_list=0x7f94c0011eb0, alter_info=0x7f9534213c80, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10470
      #21 0x00005653cffcf0cf in Sql_cmd_alter_table::execute (this=0x7f94c00126a8, thd=0x7f94c0000af0) at /data/src/10.4/sql/sql_alter.cc:508
      #22 0x00005653cfe4db75 in mysql_execute_command (thd=0x7f94c0000af0) at /data/src/10.4/sql/sql_parse.cc:6102
      #23 0x00005653cfe53237 in mysql_parse (thd=0x7f94c0000af0, rawbuf=0x7f94c0011d68 "ALTER TABLE t1 CHANGE IF EXISTS b a INT, ALGORITHM=COPY /* QNO 169 CON_ID 12 */", length=79, parser_state=0x7f95342151b0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7901
      #24 0x00005653cfe3e3dc in dispatch_command (command=COM_QUERY, thd=0x7f94c0000af0, packet=0x7f94c037ebf1 "ALTER TABLE t1 CHANGE IF EXISTS b a INT, ALGORITHM=COPY /* QNO 169 CON_ID 12 */ ", packet_length=80, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
      #25 0x00005653cfe3ca69 in do_command (thd=0x7f94c0000af0) at /data/src/10.4/sql/sql_parse.cc:1360
      #26 0x00005653cffc59df in do_handle_one_connection (connect=0x5653d3484930) at /data/src/10.4/sql/sql_connect.cc:1412
      #27 0x00005653cffc572e in handle_one_connection (arg=0x5653d3484930) at /data/src/10.4/sql/sql_connect.cc:1316
      #28 0x00007f95391754a4 in start_thread (arg=0x7f9534216700) at pthread_create.c:456
      #29 0x00007f95372a9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.2-10.4.
      Both debug and non-debug are affected.
      Couldn't reproduce on 10.1 and 10.5.

      To reproduce:

      git clone https://github.com/MariaDB/randgen --branch mdev21329 rqg-mdev21329
      cd rqg-mdev21329
      perl runall-new.pl --basedir=<your basedir>  --grammar=mdev21329.yy --duration=600 --threads=2 --scenario=Restart --skip-gendata --seed=1 --scenario-restart-interval=20 --vardir=/dev/shm/vardir-mdev21329
      

      Remember to set the path to the basedir on the command line.

      The test runs the following two statements concurrently on a table with fulltext index:

          INSERT INTO t1 () VALUES () |
          ALTER TABLE t1 CHANGE IF EXISTS <field> <field> INT, ALGORITHM=COPY;
      

      and restarts the server every 20 seconds.

      Currently it takes a few minutes to fail on my machine, but it can vary on different machines and builds.

      Variations of the assertion representation:

      10.2 ef1e488b

      2020-01-03 14:49:39 0x7f8f59057700  InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/sync/sync0rw.cc line 259
      InnoDB: Failing assertion: lock->lock_word == X_LOCK_DECR
      

      10.3 02e30069

      2020-01-03 14:48:58 0x7fbc04232700  InnoDB: Assertion failure in file /data/src/10.3/storage/innobase/sync/sync0rw.cc line 258
      InnoDB: Failing assertion: my_atomic_load32_explicit(&lock->lock_word, MY_MEMORY_ORDER_RELAXED) == X_LOCK_DECR
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: