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

Assertion `state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE' failed

    XMLWordPrintable

    Details

      Description

      SET SESSION transaction isolation level SERIALIZABLE;
      CREATE TABLE t2 (c1 INT NOT NULL PRIMARY KEY);
      XA START 'test';
      SELECT * FROM mysql.innodb_index_stats WHERE table_name='t2' AND index_name='SECOND';
      INSERT INTO t2 VALUES (1);
      INSERT INTO t2 VALUES (2);
      UPDATE mysql.innodb_table_stats SET last_update="2020-01-01" WHERE database_name="mysql" AND table_name="t2";
      

      Leads to:

      10.7.0 92e52a0c582e435e2b8fe4c4d6c615e19080e9be (Debug)

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

      10.7.0 92e52a0c582e435e2b8fe4c4d6c615e19080e9be (Debug)

      Core was generated by `/test/GAL_MD300921-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --c'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x14e3599f4700 (LWP 1613957))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055b926594b16 in my_write_core (sig=sig@entry=6) at /test/10.7_dbg/mysys/stacktrace.c:424
      #2  0x000055b925d8c445 in handle_fatal_signal (sig=6) at /test/10.7_dbg/sql/signal_handler.cc:345
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014e37d2cd859 in __GI_abort () at abort.c:79
      #6  0x000014e37d2cd729 in __assert_fail_base (fmt=0x14e37d463588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b9269f0278 "state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE", file=0x55b9269ef5b0 "/test/10.7_dbg/storage/innobase/trx/trx0trx.cc", line=461, function=<optimized out>) at assert.c:92
      #7  0x000014e37d2def36 in __GI___assert_fail (assertion=assertion@entry=0x55b9269f0278 "state == TRX_STATE_PREPARED || state == TRX_STATE_PREPARED_RECOVERED || state == TRX_STATE_ACTIVE", file=file@entry=0x55b9269ef5b0 "/test/10.7_dbg/storage/innobase/trx/trx0trx.cc", line=line@entry=461, function=function@entry=0x55b9269f02da "void trx_t::commit_state()") at assert.c:101
      #8  0x000055b92636f49e in trx_t::commit_state (this=0x14e37c114390) at /usr/include/c++/9/atomic:250
      #9  0x000055b92636fa9a in trx_t::commit_in_memory (this=this@entry=0x14e37c114390, mtr=mtr@entry=0x0) at /test/10.7_dbg/storage/innobase/trx/trx0trx.cc:1269
      #10 0x000055b92636af57 in trx_t::commit_low (this=this@entry=0x14e37c114390, mtr=0x0) at /test/10.7_dbg/storage/innobase/trx/trx0trx.cc:1448
      #11 0x000055b92636b1cf in trx_t::commit_persist (this=this@entry=0x14e37c114390) at /test/10.7_dbg/storage/innobase/trx/trx0trx.cc:1462
      #12 0x000055b92636b3a1 in trx_t::commit (this=this@entry=0x14e37c114390) at /test/10.7_dbg/storage/innobase/trx/trx0trx.cc:1468
      #13 0x000055b926479b31 in dict_stats_save (table_orig=table_orig@entry=0x14e324021718, only_for_index=only_for_index@entry=0x0) at /test/10.7_dbg/storage/innobase/dict/dict0stats.cc:2729
      #14 0x000055b92647cd14 in dict_stats_update (table=table@entry=0x14e324021718, stats_upd_option=stats_upd_option@entry=DICT_STATS_RECALC_PERSISTENT) at /test/10.7_dbg/storage/innobase/dict/dict0stats.cc:3469
      #15 0x000055b92647f0f6 in dict_stats_process_entry_from_recalc_pool (thd=0x14e3500046d8) at /test/10.7_dbg/storage/innobase/dict/dict0stats_bg.cc:340
      #16 dict_stats_func () at /test/10.7_dbg/storage/innobase/dict/dict0stats_bg.cc:393
      #17 0x000055b9265220ee in tpool::thread_pool_generic::timer_generic::run (this=0x55b929207a60) at /test/10.7_dbg/tpool/tpool_generic.cc:313
      #18 tpool::thread_pool_generic::timer_generic::execute (arg=0x55b929207a60) at /test/10.7_dbg/tpool/tpool_generic.cc:333
      #19 0x000055b92652305d in tpool::task::execute (this=0x55b929207aa0) at /test/10.7_dbg/tpool/task.cc:52
      #20 0x000055b926521c07 in tpool::thread_pool_generic::worker_main (this=0x55b928e6b060, thread_var=0x55b928e7ac80) at /test/10.7_dbg/tpool/tpool_generic.cc:550
      #21 0x000055b926521f40 in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__t=<optimized out>, __f=<optimized out>) at /usr/include/c++/9/bits/invoke.h:89
      #22 std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
      #23 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
      #24 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
      #25 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=<optimized out>) at /usr/include/c++/9/thread:195
      #26 0x000014e37d6c1d84 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
      #27 0x000014e37d7db609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #28 0x000014e37d3ca293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.6.5 (dbg), 10.7.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.41 (dbg), 10.3.32 (dbg), 10.4.22 (dbg), 10.5.13 (dbg)

        Attachments

          Activity

            People

            Assignee:
            marko Marko Mäkelä
            Reporter:
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration