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

Assertion `trx_state == TRX_STATE_PREPARED || trx_state == TRX_STATE_PREPARED_RECOVERED || trx_state == TRX_STATE_ACTIVE' failed in void trx_t::commit_state()

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
      --let $restart_parameters=--innodb-rollback-on-timeout=1
      --source include/restart_mysqld.inc
       
      SET SESSION pseudo_slave_mode=ON;
      CREATE TABLE t (a INT);
      XA START 'a';
      INSERT INTO t VALUES (1);
      XA END 'a';
      XA PREPARE 'a';
      ALTER TABLE t IMPORT TABLESPACE;
      

      Leads to:

      CS 10.6.21 155203c3521babed20636df15a1547d94f732469 (Debug)

      mariadbd: /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:466: void trx_t::commit_state(): Assertion `trx_state == TRX_STATE_PREPARED || trx_state == TRX_STATE_PREPARED_RECOVERED || trx_state == TRX_STATE_ACTIVE' failed.
      

      CS 10.6.21 155203c3521babed20636df15a1547d94f732469 (Debug)

      Core was generated by `/test/MD131224-mariadb-10.6.21-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14c55c0da700 (LWP 3076972))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014c567eee859 in __GI_abort () at abort.c:79
      #2  0x000014c567eee729 in __assert_fail_base (fmt=0x14c568084588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5609dd292210 "trx_state == TRX_STATE_PREPARED || trx_state == TRX_STATE_PREPARED_RECOVERED || trx_state == TRX_STATE_ACTIVE", file=0x5609dd291720 "/test/10.6_dbg/storage/innobase/trx/trx0trx.cc", line=466, function=<optimized out>) at assert.c:92
      #3  0x000014c567efffd6 in __GI___assert_fail (assertion=assertion@entry=0x5609dd292210 "trx_state == TRX_STATE_PREPARED || trx_state == TRX_STATE_PREPARED_RECOVERED || trx_state == TRX_STATE_ACTIVE", file=file@entry=0x5609dd291720 "/test/10.6_dbg/storage/innobase/trx/trx0trx.cc", line=line@entry=466, function=function@entry=0x5609dd29145c "void trx_t::commit_state()") at assert.c:101
      #4  0x00005609dcc3a532 in trx_t::commit_state (this=0x14c55f71f600) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:466
      #5  trx_t::commit_in_memory (mtr=0x0, this=0x14c55f71f600) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1417
      #6  trx_t::commit_low (this=this@entry=0x14c55f71f600, mtr=0x0) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1585
      #7  0x00005609dcc3b0ab in trx_t::commit_persist (this=this@entry=0x14c55f71f600) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1599
      #8  0x00005609dcc3b115 in trx_t::commit (this=0x14c55f71f600) at /test/10.6_dbg/storage/innobase/trx/trx0trx.cc:1608
      #9  0x00005609dca0ddf6 in ha_innobase::discard_or_import_tablespace (this=0x14c51c030850, discard=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13449
      #10 0x00005609dc6d5ad7 in handler::ha_discard_or_import_tablespace (this=0x14c51c030850, discard=discard@entry=0 '\000') at /test/10.6_dbg/sql/handler.cc:5355
      #11 0x00005609dc4c4c77 in mysql_discard_or_import_tablespace (thd=thd@entry=0x14c51c000d48, table_list=table_list@entry=0x14c51c013278, discard=<optimized out>) at /test/10.6_dbg/sql/sql_table.cc:5651
      #12 0x00005609dc55a21e in Sql_cmd_discard_import_tablespace::execute (this=0x14c51c013980, thd=0x14c51c000d48) at /test/10.6_dbg/sql/sql_alter.cc:712
      #13 0x00005609dc40a499 in mysql_execute_command (thd=thd@entry=0x14c51c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.6_dbg/sql/sql_parse.cc:6157
      #14 0x00005609dc3f1df2 in mysql_parse (thd=thd@entry=0x14c51c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c55c0d9320) at /test/10.6_dbg/sql/sql_parse.cc:8199
      #15 0x00005609dc40029f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c51c000d48, packet=packet@entry=0x14c51c00ade9 "ALTER TABLE t IMPORT TABLESPACE", packet_length=packet_length@entry=31, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1419
      #16 0x00005609dc4029ab in do_command (thd=thd@entry=0x14c51c000d48, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1422
      #17 0x00005609dc553c0b in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5609df8d7318, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1386
      #18 0x00005609dc5540d9 in handle_one_connection (arg=0x5609df8d7318) at /test/10.6_dbg/sql/sql_connect.cc:1298
      #19 0x000014c56841a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x000014c567feb133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      CS 11.4.5 b66d421d601443d9f5e2c49a32a81eb88fa1cd9c (Debug)

      mariadbd: /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:470: void trx_t::commit_state(): Assertion `state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE' failed.
      

      CS 11.4.5 b66d421d601443d9f5e2c49a32a81eb88fa1cd9c (Debug)

      Core was generated by `/test/MD161224-mariadb-11.4.5-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x152cb80f1700 (LWP 3085235))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000152cc17e3859 in __GI_abort () at abort.c:79
      #2  0x0000152cc17e3729 in __assert_fail_base (fmt=0x152cc1979588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5635c6da0eb8 "state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE", file=0x5635c6da0398 "/test/11.4_dbg/storage/innobase/trx/trx0trx.cc", line=470, function=<optimized out>) at assert.c:92
      #3  0x0000152cc17f4fd6 in __GI___assert_fail (assertion=assertion@entry=0x5635c6da0eb8 "state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE", file=file@entry=0x5635c6da0398 "/test/11.4_dbg/storage/innobase/trx/trx0trx.cc", line=line@entry=470, function=function@entry=0x5635c6da00d5 "void trx_t::commit_state()") at assert.c:101
      #4  0x00005635c6713455 in trx_t::commit_state (this=0x152cb85b1680) at /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:470
      #5  trx_t::commit_in_memory (mtr=0x0, this=0x152cb85b1680) at /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:1426
      #6  trx_t::commit_low (this=this@entry=0x152cb85b1680, mtr=0x0) at /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:1599
      #7  0x00005635c6713e19 in trx_t::commit_persist (this=this@entry=0x152cb85b1680) at /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:1613
      #8  0x00005635c6713e9b in trx_t::commit (this=0x152cb85b1680) at /test/11.4_dbg/storage/innobase/trx/trx0trx.cc:1622
      #9  0x00005635c64eedc4 in ha_innobase::discard_or_import_tablespace (this=0x152c70031a90, discard=<optimized out>) at /test/11.4_dbg/storage/innobase/handler/ha_innodb.cc:13364
      #10 0x00005635c61e0035 in handler::ha_discard_or_import_tablespace (this=0x152c70031a90, discard=discard@entry=0 '\000') at /test/11.4_dbg/sql/handler.cc:5542
      #11 0x00005635c5f9aed8 in mysql_discard_or_import_tablespace (thd=thd@entry=0x152c70000d48, table_list=table_list@entry=0x152c7001a748, discard=<optimized out>) at /test/11.4_dbg/sql/sql_table.cc:5848
      #12 0x00005635c6036518 in Sql_cmd_discard_import_tablespace::execute (this=0x152c7001ae58, thd=0x152c70000d48) at /test/11.4_dbg/sql/sql_alter.cc:738
      #13 0x00005635c5ec3183 in mysql_execute_command (thd=thd@entry=0x152c70000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.4_dbg/sql/sql_parse.cc:5869
      #14 0x00005635c5eaaa9b in mysql_parse (thd=thd@entry=0x152c70000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152cb80f0310) at /test/11.4_dbg/sql/sql_parse.cc:7898
      #15 0x00005635c5eb8d2a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152c70000d48, packet=packet@entry=0x152c7000afe9 "ALTER TABLE t IMPORT TABLESPACE", packet_length=packet_length@entry=31, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_class.h:1564
      #16 0x00005635c5ebb423 in do_command (thd=thd@entry=0x152c70000d48, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:1419
      #17 0x00005635c602fc5d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5635c9fd0c08, put_in_cache=put_in_cache@entry=true) at /test/11.4_dbg/sql/sql_connect.cc:1408
      #18 0x00005635c603012b in handle_one_connection (arg=0x5635c9fd0c08) at /test/11.4_dbg/sql/sql_connect.cc:1320
      #19 0x0000152cc1d0f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x0000152cc18e0133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.6.21 (dbg), 10.11.11 (dbg), 11.4.5 (dbg), 11.7.1 (dbg), 11.8.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.28 (dbg), 10.5.28 (opt), 10.6.21 (opt), 10.11.11 (opt), 11.4.5 (opt), 11.7.1 (opt), 11.8.0 (opt)

      Attachments

        Activity

          People

            marko Marko Mäkelä
            ramesh Ramesh Sivaraman
            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.